Class N

java.lang.Object
com.landawn.abacus.util.N

public final class N extends Object

Note: This class includes codes copied from Apache Commons Lang, Google Guava and other open source projects under the Apache License 2.0. The methods copied from other libraries/frameworks/projects may be modified in this class.

Class N is a general java utility class. It provides the most daily used operations for Object/primitive types/String/Array/Collection/Map/Bean...:

When to throw exception? It's designed to avoid throwing any unnecessary exception if the contract defined by method is not broken. for example, if user tries to reverse a null or empty String. the input String will be returned. But exception will be thrown if try to add element to a null Object array or collection.

An empty String/Array/Collection/Map/Iterator/Iterable/InputStream/Reader will always be a preferred choice than a null for the return value of a method.
There are only fromIndex/startIndex and {toIndex/endIndex} parameters in the methods defined in class CommonUtil/N, no offset/count parameters.
Version:
$Revision: 0.8 $ 07/03/10
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final BigDecimal[]
    An empty immutable/unmodifiable BigDecimal array.
    static final BigInteger[]
    An empty immutable/unmodifiable BigInteger array.
    static final boolean[]
    An empty immutable/unmodifiable boolean array.
    static final Boolean[]
    An empty immutable/unmodifiable Boolean array.
    static final byte[]
    An empty immutable/unmodifiable byte array.
    static final Byte[]
    An empty immutable/unmodifiable Byte array.
    static final Calendar[]
    /** An empty immutable/unmodifiable Calendar array.
    static final char[]
    An empty immutable/unmodifiable char array.
    static final Character[]
    An empty immutable/unmodifiable Character array.
    static final Date[]
    An empty immutable/unmodifiable java.sql.Date array.
    static final double[]
    An empty immutable/unmodifiable double array.
    static final Double[]
    An empty immutable/unmodifiable Double array.
    static final float[]
    An empty immutable/unmodifiable float array.
    static final Float[]
    An empty immutable/unmodifiable Float array.
    static final int[]
    An empty immutable/unmodifiable int array.
    static final Integer[]
    An empty immutable/unmodifiable Integer array.
    static final Date[]
    An empty immutable/unmodifiable java.util.Date array.
    static final LocalDate[]
    /** An empty immutable/unmodifiable LocalDate array.
    static final LocalDateTime[]
    /** An empty immutable/unmodifiable LocalDateTime array.
    static final LocalTime[]
    /** An empty immutable/unmodifiable LocalTime array.
    static final long[]
    An empty immutable/unmodifiable long array.
    static final Long[]
    An empty immutable/unmodifiable Long array.
    static final Object[]
    An empty immutable/unmodifiable Object array.
    static final short[]
    An empty immutable/unmodifiable short array.
    static final Short[]
    An empty immutable/unmodifiable Short array.
    static final String[]
    An empty immutable/unmodifiable String array.
    static final Time[]
    An empty immutable/unmodifiable Time array.
    static final Timestamp[]
    An empty immutable/unmodifiable Timestamp array.
    static final int
    The index value when an element is not found in a list or array: -1.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean[]
    add(boolean[] a, boolean elementToAdd)
    Returns a new array with elements copied from the specified array and the specified element added at the end.
    static byte[]
    add(byte[] a, byte elementToAdd)
    Returns a new array with elements copied from the specified array and the specified element added at the end.
    static char[]
    add(char[] a, char elementToAdd)
    Returns a new array with elements copied from the specified array and the specified element added at the end.
    static double[]
    add(double[] a, double elementToAdd)
    Returns a new array with elements copied from the specified array and the specified element added at the end.
    static float[]
    add(float[] a, float elementToAdd)
    Returns a new array with elements copied from the specified array and the specified element added at the end.
    static int[]
    add(int[] a, int elementToAdd)
    Returns a new array with elements copied from the specified array and the specified element added at the end.
    static long[]
    add(long[] a, long elementToAdd)
    Returns a new array with elements copied from the specified array and the specified element added at the end.
    static short[]
    add(short[] a, short elementToAdd)
    Returns a new array with elements copied from the specified array and the specified element added at the end.
    static String[]
    add(String[] a, String elementToAdd)
    Returns a new array with elements copied from the specified array and the specified element added at the end.
    static <T> T[]
    add(T[] a, T elementToAdd)
    Returns a new array with elements copied from the specified array and the specified element added at the end.
    static boolean[]
    addAll(boolean[] a, boolean... elementsToAdd)
    Returns a new array with elements copied from the specified array and the specified element added at the end.
    static byte[]
    addAll(byte[] a, byte... elementsToAdd)
    Returns a new array with elements copied from the specified array and the specified elements added at the end.
    static char[]
    addAll(char[] a, char... elementsToAdd)
    Returns a new array with elements copied from the specified array and the specified element added at the end.
    static double[]
    addAll(double[] a, double... elementsToAdd)
    Returns a new array with elements copied from the specified array and the specified elements added at the end.
    static float[]
    addAll(float[] a, float... elementsToAdd)
    Returns a new array with elements copied from the specified array and the specified elements added at the end.
    static int[]
    addAll(int[] a, int... elementsToAdd)
    Returns a new array with elements copied from the specified array and the specified elements added at the end.
    static long[]
    addAll(long[] a, long... elementsToAdd)
    Returns a new array with elements copied from the specified array and the specified elements added at the end.
    static short[]
    addAll(short[] a, short... elementsToAdd)
    Returns a new array with elements copied from the specified array and the specified elements added at the end.
    static String[]
    addAll(String[] a, String... elementsToAdd)
    Returns a new array with elements copied from the specified array and the specified elements added at the end.
    static <T> boolean
    addAll(Collection<T> c, Iterable<? extends T> elementsToAdd)
    Adds all the elements in elementsToAdd to the given collection.
    static <T> boolean
    addAll(Collection<T> c, Iterator<? extends T> elementsToAdd)
    Adds all the elements in elementsToAdd to the given collection.
    static <T> boolean
    addAll(Collection<T> c, T... elementsToAdd)
    Adds all the elements in elementsToAdd to the given collection.
    static <T> T[]
    addAll(T[] a, T... elementsToAdd)
    Returns a new array with elements copied from the specified array and the specified elements added at the end.
    static boolean
    Checks if all of the CharSequences are empty (""), null or whitespace only.
    static boolean
    Checks if both specified CharSequences are blank.
    static boolean
    Checks if all of the specified CharSequences are blank.
    static boolean
    Checks if all specified CharSequences in the collection are blank.
    static boolean
    Checks if all of the CharSequences are empty ("") or null.
    static boolean
    Checks if both specified CharSequences are empty ("") or null.
    static boolean
    Checks if all of the specified CharSequences are empty ("") or null.
    static boolean
    allEmpty(Object[] a, Object[] b)
    Checks if all specified object arrays are empty.
    static boolean
    allEmpty(Object[] a, Object[] b, Object[] c)
    Checks if all specified object arrays are empty.
    static boolean
    Checks if all specified collections are empty.
    static boolean
    Checks if all specified collections are empty.
    static boolean
    Checks if all specified CharSequences in the collection are empty or null.
    static boolean
    allFalse(boolean[] a)
    Checks if all elements in the input boolean array are false.
    static <T> boolean
    allMatch(Iterable<? extends T> c, Predicate<? super T> filter)
    Checks if all elements in the input iterable match the given predicate.
    static <T> boolean
    allMatch(Iterator<? extends T> iter, Predicate<? super T> filter)
    Checks if all elements in the input iterator match the given predicate.
    static <T> boolean
    allMatch(T[] a, Predicate<? super T> filter)
    Checks if all elements in the input array match the given predicate.
    static boolean
    Checks if all specified objects are null.
    static boolean
    Checks if both specified objects are null.
    static boolean
    Checks if all specified objects are null.
    static boolean
    Checks if all elements in the specified collection are null.
    static boolean
    allTrue(boolean[] a)
    Checks if all elements in the input boolean array are true.
    static boolean
    Checks if any of the CharSequences are empty ("") or null or whitespace only.
    static boolean
    Checks if any of the specified CharSequences is blank.
    static boolean
    Checks if any of the specified CharSequences is blank.
    static boolean
    Checks if any of the specified CharSequences in the collection is blank.
    static boolean
    Checks if any of the CharSequences is empty ("") or null.
    static boolean
    Checks if any of the specified CharSequences is empty ("") or null.
    static boolean
    Checks if any of the specified CharSequences is empty ("") or null.
    static boolean
    anyEmpty(Object[] a, Object[] b)
    Checks if any of the specified arrays is empty.
    static boolean
    anyEmpty(Object[] a, Object[] b, Object[] c)
    Checks if any of the specified arrays is empty.
    static boolean
    Checks if any of the specified collections is empty.
    static boolean
    Checks if any of the specified collections is empty.
    static boolean
    Checks if any of the specified CharSequence objects in the collection is empty.
    static boolean
    anyFalse(boolean[] a)
    Checks if any element in the input boolean array is false.
    static <T> boolean
    anyMatch(Iterable<? extends T> c, Predicate<? super T> filter)
    Checks if any element in the input iterable matches the given predicate.
    static <T> boolean
    anyMatch(Iterator<? extends T> iter, Predicate<? super T> filter)
    Checks if any element in the input iterator matches the given predicate.
    static <T> boolean
    anyMatch(T[] a, Predicate<? super T> filter)
    Checks if any element in the input array matches the given predicate.
    static boolean
    Checks if any element in the specified array is null.
    static boolean
    Checks if any of the specified objects is null.
    static boolean
    Checks if any of the specified objects is null.
    static boolean
    Checks if any element in the specified collection is null.
    static boolean
    anyTrue(boolean[] a)
    Checks if any element in the input boolean array is true.
    static <T> T[]
    asArray(T... a)
    Returns the input array as is.
    static <T> ArrayBlockingQueue<T>
    Returns a modifiable ArrayBlockingQueue with specified elements.
    static <T> ArrayDeque<T>
    asArrayDeque(T... a)
    Returns a modifiable ArrayDeque with specified elements.
    static <T> ConcurrentLinkedDeque<T>
    Returns a modifiable ConcurrentLinkedDeque with specified elements.
    static <T> ConcurrentLinkedQueue<T>
    Returns a modifiable ConcurrentLinkedQueue with specified elements.
    static <T extends Delayed>
    DelayQueue<T>
    asDelayQueue(T... a)
    Returns a modifiable DelayQueue with specified elements.
    static <T> Deque<T>
    asDeque(T... a)
    Returns a modifiable Deque with specified elements.
    static <T> LinkedBlockingDeque<T>
    Returns a modifiable asLinkedBlockingDeque with specified elements.
    static <T> LinkedBlockingQueue<T>
    Returns a modifiable LinkedBlockingQueue with specified elements.
    static <K, V> Map<K,V>
    Deprecated. 
    static <K, V> Map<K,V>
    asLinkedHashMap(K k1, V v1)
    Returns a modifiable LinkedHashMap with specified key and value.
    static <K, V> Map<K,V>
    asLinkedHashMap(K k1, V v1, K k2, V v2)
    Returns a modifiable LinkedHashMap with specified keys/values.
    static <K, V> Map<K,V>
    asLinkedHashMap(K k1, V v1, K k2, V v2, K k3, V v3)
    Returns a modifiable LinkedHashMap with specified keys/values.
    static <K, V> Map<K,V>
    asLinkedHashMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4)
    Returns a modifiable LinkedHashMap with specified keys/values.
    static <K, V> Map<K,V>
    asLinkedHashMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5)
    Returns a modifiable LinkedHashMap with specified keys/values.
    static <K, V> Map<K,V>
    asLinkedHashMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6)
    Returns a modifiable LinkedHashMap with specified keys/values.
    static <K, V> Map<K,V>
    asLinkedHashMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7)
    Returns a modifiable LinkedHashMap with specified keys/values.
    static <T> Set<T>
    Returns a modifiable LinkedHashSet with specified element.
    static <T> Set<T>
    Returns a modifiable LinkedHashSet with specified elements.
    static <T> Set<T>
    asLinkedHashSet(T e1, T e2)
    Returns a modifiable LinkedHashSet with the specified elements.
    static <T> Set<T>
    asLinkedHashSet(T e1, T e2, T e3)
    Returns a modifiable LinkedHashSet with the specified elements.
    static <T> Set<T>
    asLinkedHashSet(T e1, T e2, T e3, T e4)
    Returns a modifiable LinkedHashSet with the specified elements.
    static <T> Set<T>
    asLinkedHashSet(T e1, T e2, T e3, T e4, T e5)
    Returns a modifiable LinkedHashSet with the specified elements.
    static <T> Set<T>
    asLinkedHashSet(T e1, T e2, T e3, T e4, T e5, T e6)
    Returns a modifiable LinkedHashSet with the specified elements.
    static <T> Set<T>
    asLinkedHashSet(T e1, T e2, T e3, T e4, T e5, T e6, T e7)
    Returns a modifiable LinkedHashSet with the specified elements.
    static <T> LinkedList<T>
    Returns a modifiable LinkedList with the specified element.
    static <T> LinkedList<T>
    asLinkedList(T... a)
    Returns a modifiable LinkedList with specified elements.
    static <T> LinkedList<T>
    asLinkedList(T e1, T e2)
    Returns a modifiable LinkedList with specified elements.
    static <T> LinkedList<T>
    asLinkedList(T e1, T e2, T e3)
    Returns a modifiable LinkedList with specified elements.
    static <T> LinkedList<T>
    asLinkedList(T e1, T e2, T e3, T e4)
    Returns a modifiable LinkedList with specified elements.
    static <T> LinkedList<T>
    asLinkedList(T e1, T e2, T e3, T e4, T e5)
    Returns a modifiable LinkedList with specified elements.
    static <T> LinkedList<T>
    asLinkedList(T e1, T e2, T e3, T e4, T e5, T e6)
    Returns a modifiable LinkedList with specified elements.
    static <T> LinkedList<T>
    asLinkedList(T e1, T e2, T e3, T e4, T e5, T e6, T e7)
    Returns a modifiable LinkedList with specified elements.
    static <T> List<T>
    asList(T e)
    Returns a modifiable List with the specified element.
    static <T> List<T>
    asList(T... a)
    Returns a modifiable List with specified elements.
    static <T> List<T>
    asList(T e1, T e2)
    Returns a modifiable List with specified elements.
    static <T> List<T>
    asList(T e1, T e2, T e3)
    Returns a modifiable List with specified elements.
    static <T> List<T>
    asList(T e1, T e2, T e3, T e4)
    Returns a modifiable List with specified elements.
    static <T> List<T>
    asList(T e1, T e2, T e3, T e4, T e5)
    Returns a modifiable List with specified elements.
    static <T> List<T>
    asList(T e1, T e2, T e3, T e4, T e5, T e6)
    Returns a modifiable List with specified elements.
    static <T> List<T>
    asList(T e1, T e2, T e3, T e4, T e5, T e6, T e7)
    Returns a modifiable List with specified elements.
    static <T> List<T>
    asList(T e1, T e2, T e3, T e4, T e5, T e6, T e7, T e8)
    Returns a modifiable List with specified elements.
    static <T> List<T>
    asList(T e1, T e2, T e3, T e4, T e5, T e6, T e7, T e8, T e9)
    Returns a modifiable List with specified elements.
    static <K, V> Map<K,V>
    asMap(Object... a)
    Deprecated. 
    static <K, V> Map<K,V>
    asMap(K k1, V v1)
    Returns a modifiable Map with the specified key and value.
    static <K, V> Map<K,V>
    asMap(K k1, V v1, K k2, V v2)
    Returns a modifiable Map with the specified keys and values.
    static <K, V> Map<K,V>
    asMap(K k1, V v1, K k2, V v2, K k3, V v3)
    Returns a modifiable Map with specified keys/values.
    static <K, V> Map<K,V>
    asMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4)
    Returns a modifiable Map with specified keys/values.
    static <K, V> Map<K,V>
    asMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5)
    Returns a modifiable Map with specified keys/values.
    static <K, V> Map<K,V>
    asMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6)
    Returns a modifiable Map with specified keys/values.
    static <K, V> Map<K,V>
    asMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7)
    Returns a modifiable Map with specified keys/values.
    static <T> Multiset<T>
    asMultiset(T... a)
    Returns a modifiable Multiset with the specified elements.
    static <T> NavigableSet<T>
    Returns a modifiable NavigableSet with specified elements.
    static <T> PriorityQueue<T>
    Returns a modifiable PriorityQueue with specified elements.
    static Map<String,Object>
    Deprecated. 
    static Map<String,Object>
    asProps(String propName, Object propValue)
    Returns a modifiable Map with a specified key/value.
    static Map<String,Object>
    asProps(String propName1, Object propValue1, String propName2, Object propValue2)
    Returns a modifiable Map with specified keys/values.
    static Map<String,Object>
    asProps(String propName1, Object propValue1, String propName2, Object propValue2, String propName3, Object propValue3)
    Returns a modifiable Map with specified keys/values.
    static Map<String,Object>
    asProps(String propName1, Object propValue1, String propName2, Object propValue2, String propName3, Object propValue3, String propName4, Object propValue4)
    Returns a modifiable Map with specified keys/values.
    static Map<String,Object>
    asProps(String propName1, Object propValue1, String propName2, Object propValue2, String propName3, Object propValue3, String propName4, Object propValue4, String propName5, Object propValue5)
    Returns a modifiable Map with specified keys/values.
    static <T> Queue<T>
    asQueue(T... a)
    Returns a modifiable Queue with specified elements.
    static <T> Set<T>
    asSet(T e)
    Returns a modifiable Set with the specified element.
    static <T> Set<T>
    asSet(T... a)
    Returns a modifiable Set with specified elements.
    static <T> Set<T>
    asSet(T e1, T e2)
    Returns a modifiable Set with the specified elements.
    static <T> Set<T>
    asSet(T e1, T e2, T e3)
    Returns a modifiable Set with the specified elements.
    static <T> Set<T>
    asSet(T e1, T e2, T e3, T e4)
    Returns a modifiable Set with the specified elements.
    static <T> Set<T>
    asSet(T e1, T e2, T e3, T e4, T e5)
    Returns a modifiable Set with the specified elements.
    static <T> Set<T>
    asSet(T e1, T e2, T e3, T e4, T e5, T e6)
    Returns a modifiable Set with the specified elements.
    static <T> Set<T>
    asSet(T e1, T e2, T e3, T e4, T e5, T e6, T e7)
    Returns a modifiable Set with the specified elements.
    static <T> Set<T>
    asSet(T e1, T e2, T e3, T e4, T e5, T e6, T e7, T e8)
    Returns a modifiable Set with the specified elements.
    static <T> Set<T>
    asSet(T e1, T e2, T e3, T e4, T e5, T e6, T e7, T e8, T e9)
    Returns a modifiable Set with the specified elements.
    static <T> List<T>
    Returns an immutable list containing only the specified element.
    static <K, V> Map<K,V>
    asSingletonMap(K key, V value)
    Returns an immutable map containing only the specified key-value pair.
    static <T> Set<T>
    Returns an immutable set containing only the specified element.
    static <T> SortedSet<T>
    asSortedSet(T... a)
    Returns a modifiable SortedSet with specified elements.
    static <R> ObjIterator<R>
    asynCall(Collection<? extends Callable<? extends R>> commands)
    Executes the specified commands/tasks asynchronously and immediately returns an iterator for iterating the result lazily.
    static <R> ObjIterator<R>
    asynCall(Collection<? extends Callable<? extends R>> commands, Executor executor)
    Executes the specified commands/tasks asynchronously by the specified executor and immediately returns an iterator for iterating the result lazily.
    Executes the provided command asynchronously.
    asyncExecute(Throwables.Runnable<? extends Exception> cmd, int retryTimes, long retryIntervallInMillisInMillis, Predicate<? super Exception> retryCondition)
    Executes the provided command asynchronously with the specified retry logic in case of failure.
    asyncExecute(Throwables.Runnable<? extends Exception> command, long delayInMillis)
    Executes the provided command asynchronously with the specified delay.
    asyncExecute(Throwables.Runnable<? extends Exception> command, Executor executor)
    Executes the provided command asynchronously by the specified executor.
    static <R> List<ContinuableFuture<R>>
    asyncExecute(Collection<? extends Callable<R>> commands)
    Executes the provided a collection of commands asynchronously.
    static <R> List<ContinuableFuture<R>>
    asyncExecute(Collection<? extends Callable<R>> commands, Executor executor)
    Executes the provided a collection of commands asynchronously by the specified executor.
    static <R> ContinuableFuture<R>
    asyncExecute(Callable<R> command)
    Executes the provided command asynchronously.
    static <R> ContinuableFuture<R>
    asyncExecute(Callable<R> cmd, int retryTimes, long retryIntervallInMillisInMillis, BiPredicate<? super R,? super Exception> retryCondition)
    Executes the provided command asynchronously with the specified retry logic in case of failure.
    static <R> ContinuableFuture<R>
    asyncExecute(Callable<R> command, long delayInMillis)
    Executes the provided command asynchronously with the specified delay.
    static <R> ContinuableFuture<R>
    asyncExecute(Callable<R> command, Executor executor)
    Executes the provided command asynchronously by the specified executor.
    asyncExecute(List<? extends Throwables.Runnable<? extends Exception>> commands)
    Executes the provided a list of commands asynchronously.
    asyncExecute(List<? extends Throwables.Runnable<? extends Exception>> commands, Executor executor)
    Executes the provided a list of commands asynchronously by the specified executor.
    asynRun(Collection<? extends Throwables.Runnable<? extends Exception>> commands)
    Executes the specified commands/tasks asynchronously and immediately returns an iterator for iterating the result lazily.
    asynRun(Collection<? extends Throwables.Runnable<? extends Exception>> commands, Executor executor)
    Executes the specified commands/tasks asynchronously by the specified executor and immediately returns an iterator for iterating the result lazily.
    static double
    average(byte... a)
    Calculates the average of all elements in the given array of bytes.
    static double
    average(byte[] a, int fromIndex, int toIndex)
    Calculates the average of all elements within the specified range in the given array of bytes.
    static double
    average(char... a)
    Calculates the average of all elements in the given array of characters.
    static double
    average(char[] a, int fromIndex, int toIndex)
    Calculates the average of all elements within the specified range in the given array of characters.
    static double
    average(double... a)
    Calculates the average of all elements in the given array of doubles.
    static double
    average(double[] a, int fromIndex, int toIndex)
    Calculates the average of all elements within the specified range in the given array of doubles.
    static double
    average(float... a)
    Calculates the average of all elements in the given array of floats.
    static double
    average(float[] a, int fromIndex, int toIndex)
    Calculates the average of all elements within the specified range in the given array of floats.
    static double
    average(int... a)
    Calculates the average of all elements in the given array of ints.
    static double
    average(int[] a, int fromIndex, int toIndex)
    Calculates the average of all elements within the specified range in the given array of ints.
    static double
    average(long... a)
    Calculates the average of all elements in the given array of longs.
    static double
    average(long[] a, int fromIndex, int toIndex)
    Calculates the average of all elements within the specified range in the given array of longs.
    static double
    average(short... a)
    Calculates the average of all elements in the given array of shorts.
    static double
    average(short[] a, int fromIndex, int toIndex)
    Calculates the average of all elements within the specified range in the given array of shorts.
    static BigDecimal
    Calculates the average of the elements in the given iterable of BigDecimal.
    static <T> BigDecimal
    averageBigDecimal(Iterable<? extends T> c, Function<? super T,BigDecimal> func)
    Calculates the average of the elements in the given iterable using the provided function to convert each element to a BigDecimal.
    static BigDecimal
    Calculates the average of the elements in the given iterable of BigInteger.
    static <T> BigDecimal
    averageBigInteger(Iterable<? extends T> c, Function<? super T,BigInteger> func)
    Calculates the average of the elements in the given iterable using the provided function to convert each element to a BigInteger.
    static <T extends Number>
    double
    averageDouble(Iterable<? extends T> c)
    Calculates the average of the elements in the given iterable of numbers.
    static <T> double
    averageDouble(Iterable<? extends T> c, ToDoubleFunction<? super T> func)
    Calculates the average of the elements in the given iterable using the provided function to convert each element to a double.
    static <T extends Number>
    double
    averageDouble(Collection<? extends T> c, int fromIndex, int toIndex)
    Calculates the average of the elements in the given collection of numbers.
    static <T> double
    averageDouble(Collection<? extends T> c, int fromIndex, int toIndex, ToDoubleFunction<? super T> func)
    Calculates the average of the elements within the specified range in the input collection using the provided function to convert each element to a double.
    static <T extends Number>
    double
    Calculates the average of the elements in the given array of numbers.
    static <T extends Number>
    double
    averageDouble(T[] a, int fromIndex, int toIndex)
    Calculates the average of the elements within the specified range in the input array of numbers.
    static <T> double
    averageDouble(T[] a, int fromIndex, int toIndex, ToDoubleFunction<? super T> func)
    Calculates the average of the elements within the specified range in the input array using the provided function to convert each element to a double.
    static <T> double
    averageDouble(T[] a, ToDoubleFunction<? super T> func)
    Calculates the average of the elements in the given array using the provided function to convert each element to a double.
    static <T extends Number>
    double
    averageInt(Iterable<? extends T> c)
    Calculates the average of the elements in the given iterable of numbers.
    static <T> double
    averageInt(Iterable<? extends T> c, ToIntFunction<? super T> func)
    Calculates the average of the elements in the given iterable using the provided function to convert each element to an integer.
    static <T extends Number>
    double
    averageInt(Collection<? extends T> c, int fromIndex, int toIndex)
    Calculates the average of the elements within the specified range in the input collection of numbers.
    static <T> double
    averageInt(Collection<? extends T> c, int fromIndex, int toIndex, ToIntFunction<? super T> func)
    Calculates the average of the elements within the specified range in the input collection using the provided function to convert each element to an integer.
    static <T extends Number>
    double
    averageInt(T[] a)
    Calculates the average of the elements in the given array of numbers.
    static <T extends Number>
    double
    averageInt(T[] a, int fromIndex, int toIndex)
    Calculates the average of the elements in the given array of numbers within the specified range.
    static <T> double
    averageInt(T[] a, int fromIndex, int toIndex, ToIntFunction<? super T> func)
    Calculates the average of the elements within the specified range in the input array using the provided function to convert each element to an integer.
    static <T> double
    averageInt(T[] a, ToIntFunction<? super T> func)
    Calculates the average of the elements in the given array using the provided function to convert each element to an integer.
    static <T extends Number>
    double
    averageLong(Iterable<? extends T> c)
    Calculates the average of the elements in the given iterable of numbers.
    static <T> double
    averageLong(Iterable<? extends T> c, ToLongFunction<? super T> func)
    Calculates the average of the elements in the given iterable using the provided function to convert each element to a long.
    static <T extends Number>
    double
    averageLong(Collection<? extends T> c, int fromIndex, int toIndex)
    Calculates the average of the elements in the given collection of numbers.
    static <T> double
    averageLong(Collection<? extends T> c, int fromIndex, int toIndex, ToLongFunction<? super T> func)
    Calculates the average of the elements within the specified range in the input collection using the provided function to convert each element to a long.
    static <T extends Number>
    double
    averageLong(T[] a)
    Calculates the average of the elements in the given array of numbers.
    static <T extends Number>
    double
    averageLong(T[] a, int fromIndex, int toIndex)
    Calculates the average of the elements within the specified range in the input array of numbers.
    static <T> double
    averageLong(T[] a, int fromIndex, int toIndex, ToLongFunction<? super T> func)
    Calculates the average of the elements within the specified range in the input array using the provided function to convert each element to a long.
    static <T> double
    averageLong(T[] a, ToLongFunction<? super T> func)
    Calculates the average of the elements in the given array using the provided function to convert each element to a long.
    static int
    binarySearch(byte[] a, byte valueToFind)
    Performs a binary search on the specified array of bytes to find the specified value.
    static int
    binarySearch(byte[] a, int fromIndex, int toIndex, byte valueToFind)
    Performs a binary search on the specified range of the array of bytes to find the specified value.
    static int
    binarySearch(char[] a, char valueToFind)
    Performs a binary search on the specified array of characters to find the specified value.
    static int
    binarySearch(char[] a, int fromIndex, int toIndex, char valueToFind)
    Performs a binary search on the specified range of the array of characters to find the specified value.
    static int
    binarySearch(double[] a, double valueToFind)
    Performs a binary search on the specified array of doubles to find the specified value.
    static int
    binarySearch(double[] a, int fromIndex, int toIndex, double valueToFind)
    Performs a binary search on the specified range of the array of doubles to find the specified value.
    static int
    binarySearch(float[] a, float valueToFind)
    Performs a binary search on the specified array of floats to find the specified value.
    static int
    binarySearch(float[] a, int fromIndex, int toIndex, float valueToFind)
    Performs a binary search on the specified range of the array of floats to find the specified value.
    static int
    binarySearch(int[] a, int valueToFind)
    Performs a binary search on the specified array of ints to find the specified value.
    static int
    binarySearch(int[] a, int fromIndex, int toIndex, int valueToFind)
    Performs a binary search on the specified range of the array of ints to find the specified value.
    static int
    binarySearch(long[] a, int fromIndex, int toIndex, long valueToFind)
    Performs a binary search on the specified range of the array of longs to find the specified value.
    static int
    binarySearch(long[] a, long valueToFind)
    Performs a binary search on the specified array of longs to find the specified value.
    static int
    binarySearch(short[] a, int fromIndex, int toIndex, short valueToFind)
    Performs a binary search on the specified range of the array of shorts to find the specified value.
    static int
    binarySearch(short[] a, short valueToFind)
    Performs a binary search on the specified array of shorts to find the specified value.
    static int
    binarySearch(Object[] a, int fromIndex, int toIndex, Object valueToFind)
    Performs a binary search on the specified range of the array of objects to find the specified value.
    static int
    binarySearch(Object[] a, Object valueToFind)
    Performs a binary search on the specified array of objects to find the specified value.
    static <T extends Comparable<? super T>>
    int
    binarySearch(List<? extends T> list, int fromIndex, int toIndex, T valueToFind)
    Performs a binary search on the specified range of the list of objects to find the specified value.
    static <T> int
    binarySearch(List<? extends T> list, int fromIndex, int toIndex, T valueToFind, Comparator<? super T> cmp)
    Performs a binary search on the specified range of the list of objects to find the specified value.
    static <T extends Comparable<? super T>>
    int
    binarySearch(List<? extends T> list, T valueToFind)
    Performs a binary search on the specified list of objects to find the specified value.
    static <T> int
    binarySearch(List<? extends T> list, T valueToFind, Comparator<? super T> cmp)
    Performs a binary search on the specified list of objects to find the specified value.
    static <T> int
    binarySearch(T[] a, int fromIndex, int toIndex, T valueToFind, Comparator<? super T> cmp)
    Performs a binary search on the specified range of the array of objects to find the specified value.
    static <T> int
    binarySearch(T[] a, T valueToFind, Comparator<? super T> cmp)
    Performs a binary search on the specified array of objects to find the specified value.
    static <T, R, E extends Exception>
    List<R>
    callByBatch(Iterable<? extends T> iter, int batchSize, Throwables.Function<? super List<T>,R,E> batchAction)
    Executes the given function on batches of elements from the provided iterable.
    static <T, R, E extends Exception, E2 extends Exception>
    List<R>
    callByBatch(Iterable<? extends T> iter, int batchSize, Throwables.IntObjConsumer<? super T,E> elementConsumer, Throwables.Callable<? extends R,E2> batchAction)
    Executes the given batch action after applying the specified element consumer on each batch element with index.
    static <T, R, E extends Exception>
    List<R>
    callByBatch(Iterator<? extends T> iter, int batchSize, Throwables.Function<? super List<T>,R,E> batchAction)
    Executes the given function on batches of elements from the provided iterator.
    static <T, R, E extends Exception, E2 extends Exception>
    List<R>
    callByBatch(Iterator<? extends T> iter, int batchSize, Throwables.IntObjConsumer<? super T,E> elementConsumer, Throwables.Callable<? extends R,E2> batchAction)
    Executes the given batch action after applying the specified element consumer on each batch element with index.
    static <T, R, E extends Exception>
    List<R>
    callByBatch(T[] a, int batchSize, Throwables.Function<? super List<T>,R,E> batchAction)
    Executes the given function on batches of elements from the provided array.
    static <T, R, E extends Exception, E2 extends Exception>
    List<R>
    callByBatch(T[] a, int batchSize, Throwables.IntObjConsumer<? super T,E> elementConsumer, Throwables.Callable<? extends R,E2> batchAction)
    Executes the given batch action after applying the specified element consumer on each batch element with index.
    static <R> List<R>
    callInParallel(Collection<? extends Callable<? extends R>> commands)
    Executes the specified collection of commands/tasks in parallel.
    static <R> List<R>
    callInParallel(Collection<? extends Callable<? extends R>> commands, Executor executor)
    Executes the specified collection of commands/tasks in parallel.
    static <R, R2> Tuple.Tuple2<R,R2>
    callInParallel(Callable<R> command, Callable<R2> command2)
    Executes and completes the input commands in parallel.
    static <R, R2, R3>
    Tuple.Tuple3<R,R2,R3>
    callInParallel(Callable<R> command, Callable<R2> command2, Callable<R3> command3)
    Executes the specified commands in parallel and returns a tuple containing the results.
    static <R, R2, R3, R4>
    Tuple.Tuple4<R,R2,R3,R4>
    callInParallel(Callable<R> command, Callable<R2> command2, Callable<R3> command3, Callable<R4> command4)
    Executes the specified commands in parallel and returns a tuple containing the results.
    static <R, R2, R3, R4, R5>
    Tuple.Tuple5<R,R2,R3,R4,R5>
    callInParallel(Callable<R> command, Callable<R2> command2, Callable<R3> command3, Callable<R4> command4, Callable<R5> command5)
    Executes the specified commands in parallel and returns a tuple containing the results.
    static <T> T
    Note: Copied from Google Guava under Apache License v2.0

    If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.
    static <T> T
    Note: Copied from Google Guava under Apache License v2.0

    If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.
    static <T> T
    callUninterruptibly(Throwables.LongFunction<? extends T,InterruptedException> cmd, long timeoutInMillis)
    Note: Copied from Google Guava under Apache License v2.0

    If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.
    static <T> u.Nullable<T>
    castIfAssignable(Object val, com.landawn.abacus.type.Type<? extends T> targetType)
    Casts the given object to the specified target type if possible using the provided Type instance.
    static <T> u.Nullable<T>
    castIfAssignable(Object val, Class<? extends T> targetType)
    Casts the given object to the specified target type if possible.
    static <T extends CharSequence>
    T
    checkArgNotBlank(T arg, String msg)
    Checks if the specified charSequence argument is not null or empty or blank, and throws IllegalArgumentException if it is.
    static boolean[]
    checkArgNotEmpty(boolean[] arg, String argNameOrErrorMsg)
    Checks if the specified boolean array argument is not null or empty, and throws IllegalArgumentException if it is.
    static byte[]
    checkArgNotEmpty(byte[] arg, String argNameOrErrorMsg)
    Checks if the specified byte array argument is not null or empty, and throws IllegalArgumentException if it is.
    static char[]
    checkArgNotEmpty(char[] arg, String argNameOrErrorMsg)
    Checks if the specified char array argument is not null or empty, and throws IllegalArgumentException if it is.
    static double[]
    checkArgNotEmpty(double[] arg, String argNameOrErrorMsg)
    Checks if the specified double array argument is not null or empty, and throws IllegalArgumentException if it is.
    static float[]
    checkArgNotEmpty(float[] arg, String argNameOrErrorMsg)
    Checks if the specified float array argument is not null or empty, and throws IllegalArgumentException if it is.
    static int[]
    checkArgNotEmpty(int[] arg, String argNameOrErrorMsg)
    Checks if the specified int array argument is not null or empty, and throws IllegalArgumentException if it is.
    static long[]
    checkArgNotEmpty(long[] arg, String argNameOrErrorMsg)
    Checks if the specified long array argument is not null or empty, and throws IllegalArgumentException if it is.
    static short[]
    checkArgNotEmpty(short[] arg, String argNameOrErrorMsg)
    Checks if the specified short array argument is not null or empty, and throws IllegalArgumentException if it is.
    static <T> Multiset<T>
    checkArgNotEmpty(Multiset<T> arg, String argNameOrErrorMsg)
    Checks if the specified Multiset argument is not null or empty, and throws IllegalArgumentException if it is.
    static <T> T[]
    checkArgNotEmpty(T[] arg, String argNameOrErrorMsg)
    Checks if the specified Object array argument is not null or empty, and throws IllegalArgumentException if it is.
    static <T extends CharSequence>
    T
    checkArgNotEmpty(T arg, String argNameOrErrorMsg)
    Checks if the specified charSequence argument is null or empty, and throws IllegalArgumentException if it is.
    static byte
    checkArgNotNegative(byte arg, String argNameOrErrorMsg)
    Checks if the specified byte argument is not negative, and throws IllegalArgumentException if it is.
    static double
    checkArgNotNegative(double arg, String argNameOrErrorMsg)
    Checks if the specified double argument is not negative, and throws IllegalArgumentException if it is.
    static float
    checkArgNotNegative(float arg, String argNameOrErrorMsg)
    Checks if the specified float argument is not negative, and throws IllegalArgumentException if it is.
    static int
    checkArgNotNegative(int arg, String argNameOrErrorMsg)
    Checks if the specified int argument is not negative, and throws IllegalArgumentException if it is.
    static long
    checkArgNotNegative(long arg, String argNameOrErrorMsg)
    Checks if the specified long argument is not negative, and throws IllegalArgumentException if it is.
    static short
    checkArgNotNegative(short arg, String argNameOrErrorMsg)
    Checks if the specified short argument is not negative, and throws IllegalArgumentException if it is.
    static <T> T
    Checks if the specified argument is not null, and throws IllegalArgumentException if it is.
    static <T> T
    checkArgNotNull(T obj, String errorMessage)
    Checks if the specified argument is not null, and throws IllegalArgumentException if it is.
    static byte
    checkArgPositive(byte arg, String argNameOrErrorMsg)
    Checks if the specified byte argument is positive, and throws IllegalArgumentException if it is not.
    static double
    checkArgPositive(double arg, String argNameOrErrorMsg)
    Checks if the specified double argument is positive, and throws IllegalArgumentException if it is not.
    static float
    checkArgPositive(float arg, String argNameOrErrorMsg)
    Checks if the specified float argument is positive, and throws IllegalArgumentException if it is not.
    static int
    checkArgPositive(int arg, String argNameOrErrorMsg)
    Checks if the specified int argument is positive, and throws IllegalArgumentException if it is not.
    static long
    checkArgPositive(long arg, String argNameOrErrorMsg)
    Checks if the specified long argument is positive, and throws IllegalArgumentException if it is not.
    static short
    checkArgPositive(short arg, String argNameOrErrorMsg)
    Checks if the specified short argument is positive, and throws IllegalArgumentException if it is not.
    static void
    checkArgument(boolean expression)
    Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
    static void
    checkArgument(boolean expression, Object errorMessage)
    Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
    static void
    checkArgument(boolean b, String errorMessageTemplate, char p)
    Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
    static void
    checkArgument(boolean b, String errorMessageTemplate, char p1, char p2)
    Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
    static void
    checkArgument(boolean b, String errorMessageTemplate, char p1, double p2)
    Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
    static void
    checkArgument(boolean b, String errorMessageTemplate, char p1, int p2)
    Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
    static void
    checkArgument(boolean b, String errorMessageTemplate, char p1, long p2)
    Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
    static void
    checkArgument(boolean b, String errorMessageTemplate, char p1, Object p2)
    Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
    static void
    checkArgument(boolean b, String errorMessageTemplate, double p)
    Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
    static void
    checkArgument(boolean b, String errorMessageTemplate, double p1, char p2)
    Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
    static void
    checkArgument(boolean b, String errorMessageTemplate, double p1, double p2)
    Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
    static void
    checkArgument(boolean b, String errorMessageTemplate, double p1, int p2)
    Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
    static void
    checkArgument(boolean b, String errorMessageTemplate, double p1, long p2)
    Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
    static void
    checkArgument(boolean b, String errorMessageTemplate, double p1, Object p2)
    Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
    static void
    checkArgument(boolean b, String errorMessageTemplate, int p)
    Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
    static void
    checkArgument(boolean b, String errorMessageTemplate, int p1, char p2)
    Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
    static void
    checkArgument(boolean b, String errorMessageTemplate, int p1, double p2)
    Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
    static void
    checkArgument(boolean b, String errorMessageTemplate, int p1, int p2)
    Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
    static void
    checkArgument(boolean b, String errorMessageTemplate, int p1, long p2)
    Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
    static void
    checkArgument(boolean b, String errorMessageTemplate, int p1, Object p2)
    Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
    static void
    checkArgument(boolean b, String errorMessageTemplate, long p)
    Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
    static void
    checkArgument(boolean b, String errorMessageTemplate, long p1, char p2)
    Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
    static void
    checkArgument(boolean b, String errorMessageTemplate, long p1, double p2)
    Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
    static void
    checkArgument(boolean b, String errorMessageTemplate, long p1, int p2)
    Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
    static void
    checkArgument(boolean b, String errorMessageTemplate, long p1, long p2)
    Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
    static void
    checkArgument(boolean b, String errorMessageTemplate, long p1, Object p2)
    Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
    static void
    checkArgument(boolean b, String errorMessageTemplate, Object p)
    Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
    static void
    checkArgument(boolean expression, String errorMessageTemplate, Object... errorMessageArgs)
    Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
    static void
    checkArgument(boolean b, String errorMessageTemplate, Object p1, char p2)
    Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
    static void
    checkArgument(boolean b, String errorMessageTemplate, Object p1, double p2)
    Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
    static void
    checkArgument(boolean b, String errorMessageTemplate, Object p1, int p2)
    Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
    static void
    checkArgument(boolean b, String errorMessageTemplate, Object p1, long p2)
    Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
    static void
    checkArgument(boolean b, String errorMessageTemplate, Object p1, Object p2)
    Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
    static void
    checkArgument(boolean b, String errorMessageTemplate, Object p1, Object p2, Object p3)
    Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
    static void
    checkArgument(boolean b, String errorMessageTemplate, Object p1, Object p2, Object p3, Object p4)
    Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
    static void
    checkArgument(boolean b, Supplier<String> errorMessageSupplier)
    Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
    static int
    checkElementIndex(int index, int size)
    Copied from Google Guava under Apache License v2.0 and may be modified.
    static int
    checkElementIndex(int index, int size, String desc)
    Copied from Google Guava under Apache License v2.0 and may be modified.
    static void
    Checks if the specified array not contains any null element, and throws IllegalArgumentException if it does.
    static void
    checkElementNotNull(Object[] a, String argNameOrErrorMsg)
    Checks if the specified array not contains any null element, and throws IllegalArgumentException if it does.
    static void
    Check if the specified Collection not contains any null element, and throws IllegalArgumentException if it does.
    static void
    checkElementNotNull(Collection<?> c, String argNameOrErrorMsg)
    Check if the specified Collection not contains any null element, and throws IllegalArgumentException if it does.
    static void
    checkFromIndexSize(int fromIndex, int size, int length)
    Checks if the specified range starting from fromIndex with the specified size is within the bounds of the specified length.
    static void
    checkFromToIndex(int fromIndex, int toIndex, int length)
    Checks if the specified range starting from fromIndex and ending with toIndex are within the bounds of the specified length.
    static int
    checkIndex(int index, int size)
    Deprecated.
    static void
    Check if the specified Map not contains any null key, and throws IllegalArgumentException if it does.
    static void
    checkKeyNotNull(Map<?,?> m, String argNameOrErrorMsg)
    Check if the specified Map not contains any null key, and throws IllegalArgumentException if it does.
    static int
    checkPositionIndex(int index, int size)
    Copied from Google Guava under Apache License v2.0 and may be modified.
    static int
    checkPositionIndex(int index, int size, String desc)
    Copied from Google Guava under Apache License v2.0 and may be modified.
    static void
    checkState(boolean expression)
    Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
    static void
    checkState(boolean expression, Object errorMessage)
    Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
    static void
    checkState(boolean b, String errorMessageTemplate, char p)
    Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
    static void
    checkState(boolean b, String errorMessageTemplate, char p1, char p2)
    Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
    static void
    checkState(boolean b, String errorMessageTemplate, char p1, double p2)
    Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
    static void
    checkState(boolean b, String errorMessageTemplate, char p1, int p2)
    Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
    static void
    checkState(boolean b, String errorMessageTemplate, char p1, long p2)
    Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
    static void
    checkState(boolean b, String errorMessageTemplate, char p1, Object p2)
    Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
    static void
    checkState(boolean b, String errorMessageTemplate, double p)
    Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
    static void
    checkState(boolean b, String errorMessageTemplate, double p1, char p2)
    Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
    static void
    checkState(boolean b, String errorMessageTemplate, double p1, double p2)
    Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
    static void
    checkState(boolean b, String errorMessageTemplate, double p1, int p2)
    Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
    static void
    checkState(boolean b, String errorMessageTemplate, double p1, long p2)
    Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
    static void
    checkState(boolean b, String errorMessageTemplate, double p1, Object p2)
    Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
    static void
    checkState(boolean b, String errorMessageTemplate, int p)
    Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
    static void
    checkState(boolean b, String errorMessageTemplate, int p1, char p2)
    Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
    static void
    checkState(boolean b, String errorMessageTemplate, int p1, double p2)
    Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
    static void
    checkState(boolean b, String errorMessageTemplate, int p1, int p2)
    Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
    static void
    checkState(boolean b, String errorMessageTemplate, int p1, long p2)
    Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
    static void
    checkState(boolean b, String errorMessageTemplate, int p1, Object p2)
    Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
    static void
    checkState(boolean b, String errorMessageTemplate, long p)
    Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
    static void
    checkState(boolean b, String errorMessageTemplate, long p1, char p2)
    Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
    static void
    checkState(boolean b, String errorMessageTemplate, long p1, double p2)
    Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
    static void
    checkState(boolean b, String errorMessageTemplate, long p1, int p2)
    Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
    static void
    checkState(boolean b, String errorMessageTemplate, long p1, long p2)
    Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
    static void
    checkState(boolean b, String errorMessageTemplate, long p1, Object p2)
    Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
    static void
    checkState(boolean b, String errorMessageTemplate, Object p)
    Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
    static void
    checkState(boolean expression, String errorMessageTemplate, Object... errorMessageArgs)
    Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
    static void
    checkState(boolean b, String errorMessageTemplate, Object p1, char p2)
    Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
    static void
    checkState(boolean b, String errorMessageTemplate, Object p1, double p2)
    Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
    static void
    checkState(boolean b, String errorMessageTemplate, Object p1, int p2)
    Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
    static void
    checkState(boolean b, String errorMessageTemplate, Object p1, long p2)
    Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
    static void
    checkState(boolean b, String errorMessageTemplate, Object p1, Object p2)
    Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
    static void
    checkState(boolean b, String errorMessageTemplate, Object p1, Object p2, Object p3)
    Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
    static void
    checkState(boolean b, String errorMessageTemplate, Object p1, Object p2, Object p3, Object p4)
    Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
    static void
    checkState(boolean b, Supplier<String> errorMessageSupplier)
    Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
    static void
    Check if the specified Map not contains any null value, and throws IllegalArgumentException if it does.
    static void
    checkValueNotNull(Map<?,?> m, String argNameOrErrorMsg)
    Check if the specified Map not contains any null value, and throws IllegalArgumentException if it does.
    static boolean[]
    clone(boolean[] original)
    Returns a new array that is a clone of the specified array, or null if the original array is null.
    static boolean[][]
    clone(boolean[][] original)
    Clone the original array and its sub arrays.
    static boolean[][][]
    clone(boolean[][][] original)
    Clone the original array and its sub arrays.
    static byte[]
    clone(byte[] original)
    Returns a new array that is a clone of the specified array, or null if the original array is null.
    static byte[][]
    clone(byte[][] original)
    Clone the original array and its sub arrays.
    static byte[][][]
    clone(byte[][][] original)
    Clone the original array and its sub arrays.
    static char[]
    clone(char[] original)
    Returns a new array that is a clone of the specified array, or null if the original array is null.
    static char[][]
    clone(char[][] original)
    Clone the original array and its sub arrays.
    static char[][][]
    clone(char[][][] original)
    Clone the original array and its sub arrays.
    static double[]
    clone(double[] original)
    Returns a new array that is a clone of the specified array, or null if the original array is null.
    static double[][]
    clone(double[][] original)
    Clone the original array and its sub arrays.
    static double[][][]
    clone(double[][][] original)
    Clone the original array and its sub arrays.
    static float[]
    clone(float[] original)
    Returns a new array that is a clone of the specified array, or null if the original array is null.
    static float[][]
    clone(float[][] original)
    Clone the original array and its sub arrays.
    static float[][][]
    clone(float[][][] original)
    Clone the original array and its sub arrays.
    static int[]
    clone(int[] original)
    Returns a new array that is a clone of the specified array, or null if the original array is null.
    static int[][]
    clone(int[][] original)
    Clone the original array and its sub arrays.
    static int[][][]
    clone(int[][][] original)
    Clone the original array and its sub arrays.
    static long[]
    clone(long[] original)
    Returns a new array that is a clone of the specified array, or null if the original array is null.
    static long[][]
    clone(long[][] original)
    Clone the original array and its sub arrays.
    static long[][][]
    clone(long[][][] original)
    Clone the original array and its sub arrays.
    static short[]
    clone(short[] original)
    Returns a new array that is a clone of the specified array, or null if the original array is null.
    static short[][]
    clone(short[][] original)
    Clone the original array and its sub arrays.
    static short[][][]
    clone(short[][][] original)
    Clone the original array and its sub arrays.
    static <T> T
    clone(Object obj, Class<? extends T> targetType)
    Deeply copy by: obj -> serialize -> kryo/Json -> deserialize -> new object.
    static <T> T
    clone(T obj)
    Clones the given object.
    static <T> T[]
    clone(T[] original)
    Returns a new array that is a clone of the specified array, or null if the original array is null.
    static <T> T[][]
    clone(T[][] original)
    Clone the original array and its sub arrays.
    static <T> T[][][]
    clone(T[][][] original)
    Clone the original array and its sub arrays.
    static <T> Set<T>
    commonSet(Collection<? extends Collection<? extends T>> c)
    Returns a set containing the common elements among all the collections within the specified collection of collections.
    static <T> Set<T>
    commonSet(Collection<? extends T> a, Collection<?> b)
    Returns a set containing the common elements between the specified collections a and b.
    static int
    compare(boolean[] a, boolean[] b)
    Compares two arrays lexicographically.
    static int
    compare(boolean[] a, int fromIndexA, boolean[] b, int fromIndexB, int len)
    Compares two arrays lexicographically over the specified range.
    static int
    compare(boolean a, boolean b)
    Compares two boolean values.
    static int
    compare(byte[] a, byte[] b)
    Compares two arrays lexicographically.
    static int
    compare(byte[] a, int fromIndexA, byte[] b, int fromIndexB, int len)
    Compares two arrays lexicographically over the specified range.
    static int
    compare(byte a, byte b)
    Compares two byte values.
    static int
    compare(char[] a, char[] b)
    Compares two arrays lexicographically.
    static int
    compare(char[] a, int fromIndexA, char[] b, int fromIndexB, int len)
    Compares two arrays lexicographically over the specified range.
    static int
    compare(char a, char b)
    Compares two char values.
    static int
    compare(double[] a, double[] b)
    Compares two arrays lexicographically.
    static int
    compare(double[] a, int fromIndexA, double[] b, int fromIndexB, int len)
    Compares two arrays lexicographically over the specified range.
    static int
    compare(double a, double b)
    Compares two double values.
    static int
    compare(float[] a, float[] b)
    Compares two arrays lexicographically.
    static int
    compare(float[] a, int fromIndexA, float[] b, int fromIndexB, int len)
    Compares two arrays lexicographically over the specified range.
    static int
    compare(float a, float b)
    Compares two float values.
    static int
    compare(int[] a, int[] b)
    Compares two arrays lexicographically.
    static int
    compare(int[] a, int fromIndexA, int[] b, int fromIndexB, int len)
    Compares two arrays lexicographically over the specified range.
    static int
    compare(int a, int b)
    Compares two int values.
    static int
    compare(long[] a, int fromIndexA, long[] b, int fromIndexB, int len)
    Compares two arrays lexicographically over the specified range.
    static int
    compare(long[] a, long[] b)
    Compares two arrays lexicographically.
    static int
    compare(long a, long b)
    Compares two long values.
    static int
    compare(short[] a, int fromIndexA, short[] b, int fromIndexB, int len)
    Compares two arrays lexicographically over the specified range.
    static int
    compare(short[] a, short[] b)
    Compares two arrays lexicographically.
    static int
    compare(short a, short b)
    Compares two short values.
    static <T extends Comparable<? super T>>
    int
    compare(Iterable<T> a, Iterable<T> b)
    Compares two iterables lexicographically.
    static <T> int
    compare(Iterable<T> a, Iterable<T> b, Comparator<? super T> cmp)
    Compares two iterables using the specified comparator.
    static <T> int
    compare(Collection<T> a, int fromIndexA, Collection<T> b, int fromIndexB, int len)
    Compares two collections lexicographically over the specified range.
    static <T> int
    compare(Collection<T> a, int fromIndexA, Collection<T> b, int fromIndexB, int len, Comparator<? super T> cmp)
    Compares two collections lexicographically over the specified range using the specified comparator.
    static <T extends Comparable<? super T>>
    int
    compare(Iterator<T> a, Iterator<T> b)
    Compares two iterators lexicographically.
    static <T> int
    compare(Iterator<T> a, Iterator<T> b, Comparator<? super T> cmp)
    Compares two iterators using the specified comparator.
    static <T extends Comparable<? super T>>
    int
    compare(T[] a, int fromIndexA, T[] b, int fromIndexB, int len)
    Compares two arrays lexicographically over the specified range.
    static <T> int
    compare(T[] a, int fromIndexA, T[] b, int fromIndexB, int len, Comparator<? super T> cmp)
    Compares two arrays lexicographically over the specified range using the specified comparator.
    static <T extends Comparable<? super T>>
    int
    compare(T[] a, T[] b)
    Compares two arrays lexicographically.
    static <T> int
    compare(T[] a, T[] b, Comparator<? super T> cmp)
    Compares two arrays using the specified comparator.
    static <T1 extends Comparable<T1>, T2 extends Comparable<T2>>
    int
    compare(T1 a1, T1 b1, T2 a2, T2 b2)
    Compares two pairs of values (a1, b1) and (a2, b2) until they are not equal.
    static <T1 extends Comparable<T1>, T2 extends Comparable<T2>, T3 extends Comparable<T3>>
    int
    compare(T1 a1, T1 b1, T2 a2, T2 b2, T3 a3, T3 b3)
    Compares three pairs of values (a1, b1), (a2, b2), and (a3, b3) until they are not equal.
    static <T1 extends Comparable<T1>, T2 extends Comparable<T2>, T3 extends Comparable<T3>, T4 extends Comparable<T4>>
    int
    compare(T1 a1, T1 b1, T2 a2, T2 b2, T3 a3, T3 b3, T4 a4, T4 b4)
    static <T1 extends Comparable<T1>, T2 extends Comparable<T2>, T3 extends Comparable<T3>, T4 extends Comparable<T4>, T5 extends Comparable<T5>>
    int
    compare(T1 a1, T1 b1, T2 a2, T2 b2, T3 a3, T3 b3, T4 a4, T4 b4, T5 a5, T5 b5)
    static <T1 extends Comparable<T1>, T2 extends Comparable<T2>, T3 extends Comparable<T3>, T4 extends Comparable<T4>, T5 extends Comparable<T5>, T6 extends Comparable<T6>>
    int
    compare(T1 a1, T1 b1, T2 a2, T2 b2, T3 a3, T3 b3, T4 a4, T4 b4, T5 a5, T5 b5, T6 a6, T6 b6)
    static <T1 extends Comparable<T1>, T2 extends Comparable<T2>, T3 extends Comparable<T3>, T4 extends Comparable<T4>, T5 extends Comparable<T5>, T6 extends Comparable<T6>, T7 extends Comparable<T7>>
    int
    compare(T1 a1, T1 b1, T2 a2, T2 b2, T3 a3, T3 b3, T4 a4, T4 b4, T5 a5, T5 b5, T6 a6, T6 b6, T7 a7, T7 b7)
    static <T extends Comparable<? super T>>
    int
    compare(T a, T b)
    Compares two Comparable object values.
    static <T> int
    compare(T a, T b, Comparator<? super T> cmp)
    Compares two Comparable object values using the specified Comparator.
    static int
    compareByProps(Object bean1, Object bean2, Collection<String> propNamesToCompare)
    Deprecated.
    call getPropValue by reflection APIs during comparing or sorting may have a huge impact on performance.
    static int
    Compares two arrays of strings lexicographically, ignoring case differences.
    static int
    Compares two strings lexicographically, ignoring case differences.
    static int
    compareUnsigned(byte[] a, byte[] b)
    Compares two arrays lexicographically, treating the values as unsigned.
    static int
    compareUnsigned(byte[] a, int fromIndexA, byte[] b, int fromIndexB, int len)
    Compares two subarrays lexicographically, treating the values as unsigned.
    static int
    compareUnsigned(byte a, byte b)
    Compares two unsigned byte values.
    static int
    compareUnsigned(int[] a, int[] b)
    Compares two arrays lexicographically, treating the values as unsigned.
    static int
    compareUnsigned(int[] a, int fromIndexA, int[] b, int fromIndexB, int len)
    Compares two subarrays lexicographically, treating the values as unsigned.
    static int
    compareUnsigned(int a, int b)
    Compares two unsigned int values.
    static int
    compareUnsigned(long[] a, int fromIndexA, long[] b, int fromIndexB, int len)
    Compares two subarrays lexicographically, treating the values as unsigned.
    static int
    compareUnsigned(long[] a, long[] b)
    Compares two arrays lexicographically, treating the values as unsigned.
    static int
    compareUnsigned(long a, long b)
    Compares two unsigned long values.
    static int
    compareUnsigned(short[] a, int fromIndexA, short[] b, int fromIndexB, int len)
    Compares two subarrays lexicographically, treating the values as unsigned.
    static int
    compareUnsigned(short[] a, short[] b)
    Compares two arrays lexicographically, treating the values as unsigned.
    static int
    compareUnsigned(short a, short b)
    Compares two unsigned short values.
    static boolean[]
    concat(boolean[]... aa)
    Concatenates multiple boolean arrays into a new array.
    static boolean[]
    concat(boolean[] a, boolean[] b)
    Concatenates two boolean arrays into a new array.
    static byte[]
    concat(byte[]... aa)
    Concatenates multiple byte arrays into a new array.
    static byte[]
    concat(byte[] a, byte[] b)
    Concatenates two byte arrays into a new array.
    static char[]
    concat(char[]... aa)
    Concatenates multiple char arrays into a new array.
    static char[]
    concat(char[] a, char[] b)
    Concatenates two char arrays into a new array.
    static double[]
    concat(double[]... aa)
    Concatenates multiple double arrays into a new array.
    static double[]
    concat(double[] a, double[] b)
    Concatenates two double arrays into a new array.
    static float[]
    concat(float[]... aa)
    Concatenates multiple float arrays into a new array.
    static float[]
    concat(float[] a, float[] b)
    Concatenates two float arrays into a new array.
    static int[]
    concat(int[]... aa)
    Concatenates multiple int arrays into a new array.
    static int[]
    concat(int[] a, int[] b)
    Concatenates two int arrays into a new array.
    static long[]
    concat(long[]... aa)
    Concatenates multiple long arrays into a new array.
    static long[]
    concat(long[] a, long[] b)
    Concatenates two long arrays into a new array.
    static short[]
    concat(short[]... aa)
    Concatenates multiple short arrays into a new array.
    static short[]
    concat(short[] a, short[] b)
    Concatenates two short arrays into a new array.
    static <T> List<T>
    concat(Iterable<? extends T>... a)
    Concatenates multiple iterables into a new list.
    static <T> List<T>
    concat(Iterable<? extends T> a, Iterable<? extends T> b)
    Concatenates two iterables into a new list.
    static <T> List<T>
    concat(Collection<? extends Iterable<? extends T>> c)
    Concatenates multiple iterables into a new list.
    static <T, C extends Collection<T>>
    C
    concat(Collection<? extends Iterable<? extends T>> c, IntFunction<? extends C> supplier)
    Concatenates multiple iterables into a new collection.
    static <T> ObjIterator<T>
    concat(Iterator<? extends T>... a)
    Concatenates multiple iterators into a new ObjIterator.
    static <T> ObjIterator<T>
    concat(Iterator<? extends T> a, Iterator<? extends T> b)
    Concatenates two iterators into a new ObjIterator.
    static <T> T[]
    concat(T[]... aa)
    Concatenates multiple arrays into a new array.
    static <T> T[]
    concat(T[] a, T[] b)
    Concatenates two arrays into a new array.
    static boolean
    contains(boolean[] a, boolean valueToFind)
    Checks if the specified array contains the specified value.
    static boolean
    contains(byte[] a, byte valueToFind)
    Checks if the specified array contains the specified value.
    static boolean
    contains(char[] a, char valueToFind)
    Checks if the specified array contains the specified value.
    static boolean
    contains(double[] a, double valueToFind)
    Checks if the specified array contains the specified value.
    static boolean
    contains(float[] a, float valueToFind)
    Checks if the specified array contains the specified value.
    static boolean
    contains(int[] a, int valueToFind)
    Checks if the specified array contains the specified value.
    static boolean
    contains(long[] a, long valueToFind)
    Checks if the specified array contains the specified value.
    static boolean
    contains(short[] a, short valueToFind)
    Checks if the specified array contains the specified value.
    static boolean
    contains(Iterable<?> c, Object valueToFind)
    Checks if the specified Iterable contains the specified value.
    static boolean
    contains(Object[] a, Object valueToFind)
    Checks if the specified array contains the specified value.
    static boolean
    contains(Collection<?> c, Object valueToFind)
    Checks if the specified Collection contains the specified value.
    static boolean
    contains(Iterator<?> iter, Object valueToFind)
    Checks if the specified Iterator contains the specified value.
    static boolean
    containsAll(Iterable<?> c, Collection<?> valuesToFind)
    Checks if the given Iterable contains all the elements in the specified valuesToFind Collection.
    static boolean
    containsAll(Collection<?> c, Object... valuesToFind)
    Checks if the given Collection contains all the elements in the specified valuesToFind array.
    static boolean
    containsAll(Collection<?> c, Collection<?> valuesToFind)
    Checks if the given Collection contains all the elements in the specified valuesToFind Collection.
    static boolean
    containsAll(Iterator<?> iter, Collection<?> valuesToFind)
    Checks if the given Iterator contains all the elements in the specified valuesToFind Collection.
    static boolean
    containsAny(Iterable<?> c, Set<?> valuesToFind)
    Checks if the given Iterable contains any elements from the specified valuesToFind Set.
    static boolean
    containsAny(Collection<?> c, Object... valuesToFind)
    Checks if the given Collection contains any elements from the specified valuesToFind array.
    static boolean
    containsAny(Collection<?> c, Collection<?> valuesToFind)
    Checks if the given Collection contains any elements from the specified valuesToFind Collection.
    static boolean
    containsAny(Iterator<?> iter, Set<?> valuesToFind)
    Checks if the given Iterator contains any elements from the specified valuesToFind Set.
    static boolean
    containsNone(Iterable<?> c, Set<?> valuesToFind)
    Checks if the given Iterable dosn't contain any elements from the specified valuesToFind Set.
    static boolean
    containsNone(Collection<?> c, Object... valuesToFind)
    Checks if the specified given Collection dosn't contain any elements from the specified valuesToFind array.
    static boolean
    containsNone(Collection<?> c, Collection<?> valuesToFind)
    Checks if the given Collection dosn't contain any elements from the specified valuesToFind Collection.
    static boolean
    containsNone(Iterator<?> iter, Set<?> valuesToFind)
    Checks if the given Iterator dosn't contain any elements from the specified valuesToFind Set.
    static <T> T
    convert(Object srcObj, com.landawn.abacus.type.Type<? extends T> targetType)
    Converts the given source object to the specified target type using the provided Type instance.
    static <T> T
    convert(Object srcObj, Class<? extends T> targetType)
    Converts the given source object to the specified target type.
    static void
    copy(boolean[] src, int srcPos, boolean[] dest, int destPos, int length)
    Copies elements from the source boolean array to the destination boolean array.
    static void
    copy(byte[] src, int srcPos, byte[] dest, int destPos, int length)
    Copies elements from the source byte array to the destination byte array.
    static void
    copy(char[] src, int srcPos, char[] dest, int destPos, int length)
    Copies elements from the source char array to the destination char array.
    static void
    copy(double[] src, int srcPos, double[] dest, int destPos, int length)
    Copies elements from the source double array to the destination double array.
    static void
    copy(float[] src, int srcPos, float[] dest, int destPos, int length)
    Copies elements from the source float array to the destination float array.
    static void
    copy(int[] src, int srcPos, int[] dest, int destPos, int length)
    Copies elements from the source int array to the destination int array.
    static void
    copy(long[] src, int srcPos, long[] dest, int destPos, int length)
    Copies elements from the source long array to the destination long array.
    static void
    copy(short[] src, int srcPos, short[] dest, int destPos, int length)
    Copies elements from the source short array to the destination short array.
    static void
    copy(Object[] src, int srcPos, Object[] dest, int destPos, int length)
    Copies elements from the source array to the destination array.
    static <T> T
    copy(Object sourceBean, boolean ignoreUnmatchedProperty, Set<String> ignoredPropNames, Class<? extends T> targetType)
    Returns a new instance of specified targetType with properties copied from the given source bean, except the properties specified in the ignoredPropNames set.
    static void
    copy(Object src, int srcPos, Object dest, int destPos, int length)
    Copies elements from the source array to the destination array.
    static <T> T
    copy(Object sourceBean, Class<? extends T> targetType)
    Returns a new instance of specified targetType with properties copied from the given source bean.
    static <T> T
    copy(Object sourceBean, Collection<String> selectPropNames, Class<? extends T> targetType)
    Returns a new instance of specified targetType with properties copied from the given source bean with selected properties.
    static <T> T
    copy(Object sourceBean, Collection<String> selectPropNames, Function<String,String> propNameConverter, Class<? extends T> targetType)
    Returns a new instance of specified targetType with properties copied from the given source bean with selected properties.
    static <T> T
    copy(Object sourceBean, BiPredicate<? super String,?> propFilter, Class<? extends T> targetType)
    Returns a new instance of specified targetType with properties copied from the given source bean, filtered by the specified predicate.
    static <T> T
    copy(Object sourceBean, BiPredicate<? super String,?> propFilter, Function<String,String> propNameConverter, Class<? extends T> targetType)
    Returns a new instance of specified targetType with properties copied from the given source bean, filtered by the specified predicate.
    static <T> void
    copy(List<? extends T> src, int srcPos, List<? super T> dest, int destPos, int length)
    Copies a portion of one list into another.
    static <T> void
    copy(List<? extends T> src, List<? super T> dest)
    Copies all of the elements from the source list into the destination list.
    static <T> T
    copy(T sourceBean)
    Returns a copy of the given source bean.
    static <T> T
    copy(T sourceBean, Collection<String> selectPropNames)
    Returns a copy of the given source bean with selected properties.
    static <T> T
    copy(T sourceBean, BiPredicate<? super String,?> propFilter)
    Returns a copy of the given source bean with properties filtered by the specified predicate.
    static boolean[]
    copyOf(boolean[] original, int newLength)
    Returns a new boolean array containing a copy of the original array, truncated or padded with false (if necessary) so the copy has the specified length.
    static byte[]
    copyOf(byte[] original, int newLength)
    Returns a new byte array containing a copy of the original array, truncated or padded with default value (if necessary) so the copy has the specified length.
    static char[]
    copyOf(char[] original, int newLength)
    Returns a new char array containing a copy of the original array, truncated or padded with default value (if necessary) so the copy has the specified length.
    static double[]
    copyOf(double[] original, int newLength)
    Returns a new double array containing a copy of the original array, truncated or padded with default value (if necessary) so the copy has the specified length.
    static float[]
    copyOf(float[] original, int newLength)
    Returns a new float array containing a copy of the original array, truncated or padded with default value (if necessary) so the copy has the specified length.
    static int[]
    copyOf(int[] original, int newLength)
    Returns a new int array containing a copy of the original array, truncated or padded with default value (if necessary) so the copy has the specified length.
    static long[]
    copyOf(long[] original, int newLength)
    Returns a new long array containing a copy of the original array, truncated or padded with default value (if necessary) so the copy has the specified length.
    static short[]
    copyOf(short[] original, int newLength)
    Returns a new short array containing a copy of the original array, truncated or padded with default value (if necessary) so the copy has the specified length.
    static <T> T[]
    copyOf(T[] original, int newLength)
    Returns a new Object array containing a copy of the original array, truncated or padded with null (if necessary) so the copy has the specified length.
    static <T, U> T[]
    copyOf(U[] original, int newLength, Class<? extends T[]> newType)
    Returns a new array containing a copy of the original array, truncated or padded with null (if necessary) so the copy has the specified length.
    static boolean[]
    copyOfRange(boolean[] original, int fromIndex, int toIndex)
    Returns a new boolean array containing a copy of the specified range of the original array.
    static boolean[]
    copyOfRange(boolean[] original, int fromIndex, int toIndex, int step)
    Returns a new boolean array containing a copy of the specified range of the original array, with elements selected at intervals defined by the step parameter.
    static byte[]
    copyOfRange(byte[] original, int fromIndex, int toIndex)
    Returns a new byte array containing a copy of the specified range of the original array.
    static byte[]
    copyOfRange(byte[] original, int fromIndex, int toIndex, int step)
    Returns a new byte array containing a copy of the specified range of the original array, with elements selected at intervals defined by the step parameter.
    static char[]
    copyOfRange(char[] original, int fromIndex, int toIndex)
    Returns a new char array containing a copy of the specified range of the original array.
    static char[]
    copyOfRange(char[] original, int fromIndex, int toIndex, int step)
    Returns a new char array containing a copy of the specified range of the original array, with elements selected at intervals defined by the step parameter.
    static double[]
    copyOfRange(double[] original, int fromIndex, int toIndex)
    Returns a new double array containing a copy of the specified range of the original array.
    static double[]
    copyOfRange(double[] original, int fromIndex, int toIndex, int step)
    Returns a new double array containing a copy of the specified range of the original array, with elements selected at intervals defined by the step parameter.
    static float[]
    copyOfRange(float[] original, int fromIndex, int toIndex)
    Returns a new float array containing a copy of the specified range of the original array.
    static float[]
    copyOfRange(float[] original, int fromIndex, int toIndex, int step)
    Returns a new float array containing a copy of the specified range of the original array, with elements selected at intervals defined by the step parameter.
    static int[]
    copyOfRange(int[] original, int fromIndex, int toIndex)
    Returns a new int array containing a copy of the specified range of the original array.
    static int[]
    copyOfRange(int[] original, int fromIndex, int toIndex, int step)
    Returns a new int array containing a copy of the specified range of the original array, with elements selected at intervals defined by the step parameter.
    static long[]
    copyOfRange(long[] original, int fromIndex, int toIndex)
    Returns a new long array containing a copy of the specified range of the original array.
    static long[]
    copyOfRange(long[] original, int fromIndex, int toIndex, int step)
    Returns a new long array containing a copy of the specified range of the original array, with elements selected at intervals defined by the step parameter.
    static short[]
    copyOfRange(short[] original, int fromIndex, int toIndex)
    Returns a new short array containing a copy of the specified range of the original array.
    static short[]
    copyOfRange(short[] original, int fromIndex, int toIndex, int step)
    Returns a new short array containing a copy of the specified range of the original array, with elements selected at intervals defined by the step parameter.
    static String
    copyOfRange(String str, int fromIndex, int toIndex)
    Returns a new string that is a substring of the specified string.
    static String
    copyOfRange(String str, int fromIndex, int toIndex, int step)
    Returns a new string that is a substring of the specified string, with characters selected at intervals defined by the step parameter.
    static <T> List<T>
    copyOfRange(List<T> c, int fromIndex, int toIndex)
    Returns a new list containing a copy of the specified range of the original list.
    static <T> List<T>
    copyOfRange(List<T> c, int fromIndex, int toIndex, int step)
    Returns a new list containing a copy of the specified range of the original list, with elements selected at intervals defined by the step parameter.
    static <T> T[]
    copyOfRange(T[] original, int fromIndex, int toIndex)
    Returns a new Object array containing a copy of the specified range of the original array.
    static <T> T[]
    copyOfRange(T[] original, int fromIndex, int toIndex, int step)
    Returns a new Object array containing a copy of the specified range of the original array, with elements selected at intervals defined by the step parameter.
    static <T> T[]
    copyOfRange(T[] original, int fromIndex, int toIndex, int step, Class<? extends T[]> newType)
    Returns a new array containing a copy of the specified range of the original array, with elements selected at intervals defined by the step parameter.
    static <T, U> T[]
    copyOfRange(U[] original, int fromIndex, int toIndex, Class<? extends T[]> newType)
    Returns a new array containing a copy of the specified range of the original array.
    static <T> T[]
    copyThenReplaceAll(T[] a, UnaryOperator<T> operator)
    Creates a copy of the given array and replaces all elements in the copy using the provided UnaryOperator.
    static <T, E extends Exception>
    T[]
    copyThenSetAll(T[] a, Throwables.IntObjFunction<? super T,? extends T,E> converter)
    Creates a copy of the given array and sets all elements in the copy using the provided converter function.
    static <T> T[]
    copyThenSetAll(T[] a, IntFunction<? extends T> generator)
    Creates a copy of the given array and sets all elements in the copy using the provided generator function.
    static int
    count(boolean[] a, int fromIndex, int toIndex, BooleanPredicate filter)
    Counts the number of elements within the specified range in the input boolean array that match the given predicate.
    static int
    count(boolean[] a, BooleanPredicate filter)
    Counts the number of elements in the input boolean array that match the given predicate.
    static int
    count(byte[] a, int fromIndex, int toIndex, BytePredicate filter)
    Counts the number of elements within the specified range in the input byte array that match the given predicate.
    static int
    count(byte[] a, BytePredicate filter)
    Counts the number of elements in the input byte array that match the given predicate.
    static int
    count(char[] a, int fromIndex, int toIndex, CharPredicate filter)
    Counts the number of elements within the specified range in the input byte array that match the given predicate.
    static int
    count(char[] a, CharPredicate filter)
    Counts the number of elements in the input byte array that match the given predicate.
    static int
    count(double[] a, int fromIndex, int toIndex, DoublePredicate filter)
    Counts the number of elements within the specified range in the input double array that match the given predicate.
    static int
    count(double[] a, DoublePredicate filter)
    Counts the number of elements in the input double array that match the given predicate.
    static int
    count(float[] a, int fromIndex, int toIndex, FloatPredicate filter)
    Counts the number of elements within the specified range in the input float array that match the given predicate.
    static int
    count(float[] a, FloatPredicate filter)
    Counts the number of elements in the input float array that match the given predicate.
    static int
    count(int[] a, int fromIndex, int toIndex, IntPredicate filter)
    Counts the number of elements within the specified range in the input int array that match the given predicate.
    static int
    count(int[] a, IntPredicate filter)
    Counts the number of elements in the input int array that match the given predicate.
    static int
    count(long[] a, int fromIndex, int toIndex, LongPredicate filter)
    Counts the number of elements within the specified range in the input long array that match the given predicate.
    static int
    count(long[] a, LongPredicate filter)
    Counts the number of elements in the input long array that match the given predicate.
    static int
    count(short[] a, int fromIndex, int toIndex, ShortPredicate filter)
    Counts the number of elements within the specified range in the input short array that match the given predicate.
    static int
    count(short[] a, ShortPredicate filter)
    Counts the number of elements in the input short array that match the given predicate.
    static <T> int
    count(Iterable<? extends T> c, Predicate<? super T> filter)
    Counts the number of elements in the input iterable that match the given predicate.
    static <T> int
    count(Collection<? extends T> c, int fromIndex, int toIndex, Predicate<? super T> filter)
    Counts the number of elements within the specified range in the input collection that match the given predicate.
    static int
    count(Iterator<?> iter)
    Counts the number of elements in the input iterator.
    static <T> int
    count(Iterator<? extends T> iter, Predicate<? super T> filter)
    Counts the number of elements in the input iterator that match the given predicate.
    static <T> int
    count(T[] a, int fromIndex, int toIndex, Predicate<? super T> filter)
    Counts the number of elements within the specified range in the input array that match the given predicate.
    static <T> int
    count(T[] a, Predicate<? super T> filter)
    Counts the number of elements in the input array that match the given predicate.
    static <T, K> Map<K,Integer>
    countBy(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor)
    Counts the elements in the given iterable by the key extracted by the specified Function<T, K>.
    static <T, K, M extends Map<K, Integer>>
    M
    countBy(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor, Supplier<M> mapSupplier)
    Counts the elements in the given iterable by the key extracted by the specified Function<T, K>.
    static <T, K> Map<K,Integer>
    countBy(Iterator<? extends T> iter, Function<? super T,? extends K> keyExtractor)
    Counts the elements in the given iterator by the key extracted by the specified Function<T, K>.
    static <T, K, M extends Map<K, Integer>>
    M
    countBy(Iterator<? extends T> iter, Function<? super T,? extends K> keyExtractor, Supplier<M> mapSupplier)
    Counts the elements in the given iterator by the key extracted by the specified Function<T, K>.
    static boolean
    deepEquals(Object[] a, int fromIndexA, Object[] b, int fromIndexB, int len)
    Compares two arrays for deep equality within the specified range.
    static boolean
    Compares two arrays for deep equality.
    static boolean
    Compares two objects for equality.
    static int
    Returns the hash code for the specified object.
    static int
    Returns the hash code for an array of Objects.
    static int
    deepHashCode(Object[] a, int fromIndex, int toIndex)
    Returns the hash code for a range of elements in an Object array.
    static String
    Returns a string representation of the "deep contents" of the specified object.
    static String
    Returns a string representation of the "deep contents" of the specified array.
    static String
    deepToString(Object[] a, int fromIndex, int toIndex)
    Returns a string representation of the "deep contents" of the specified range of elements in an Object array.
    static String
    deepToString(Object[] a, String defaultIfNull)
    Returns a string representation of the "deep contents" of the specified array.
    static <T extends CharSequence>
    T
    defaultIfBlank(T str, Supplier<? extends T> getterForDefaultStr)
    Returns the default value provided by specified Supplier if the specified object is blank or itself if the specified object is not blank.
    static <T extends CharSequence>
    T
    defaultIfBlank(T str, T defaultStr)
    Returns the specified default value if the specified object is blank or itself if the specified object is not blank.
    static <T extends CharSequence>
    T
    defaultIfEmpty(T str, Supplier<? extends T> getterForDefaultStr)
    Returns the default value provided by specified Supplier if the specified object is empty or itself if the specified object is not empty.
    static <T extends CharSequence>
    T
    defaultIfEmpty(T str, T defaultStr)
    Returns the specified default value if the specified object is empty or itself if the specified object is not empty.
    static boolean
    Returns the default value of the given type if the specified object is null or itself if the specified object is not null.
    static boolean
    defaultIfNull(Boolean b, boolean defaultForNull)
    Returns the specified default value if the specified object is null or itself if the specified object is not null.
    static byte
    Returns the default value of the given type if the specified object is null or itself if the specified object is not null.
    static byte
    defaultIfNull(Byte b, byte defaultForNull)
    Returns the specified default value if the specified object is null or itself if the specified object is not null.
    static char
    Returns the default value of the given type if the specified object is null or itself if the specified object is not null.
    static char
    defaultIfNull(Character c, char defaultForNull)
    Returns the specified default value if the specified object is null or itself if the specified object is not null.
    static double
    Returns the default value of the given type if the specified object is null or itself if the specified object is not null.
    static double
    defaultIfNull(Double b, double defaultForNull)
    Returns the specified default value if the specified object is null or itself if the specified object is not null.
    static float
    Returns the default value of the given type if the specified object is null or itself if the specified object is not null.
    static float
    defaultIfNull(Float b, float defaultForNull)
    Returns the specified default value if the specified object is null or itself if the specified object is not null.
    static int
    Returns the default value of the given type if the specified object is null or itself if the specified object is not null.
    static int
    defaultIfNull(Integer b, int defaultForNull)
    Returns the specified default value if the specified object is null or itself if the specified object is not null.
    static long
    Returns the default value of the given type if the specified object is null or itself if the specified object is not null.
    static long
    defaultIfNull(Long b, long defaultForNull)
    Returns the specified default value if the specified object is null or itself if the specified object is not null.
    static short
    Returns the default value of the given type if the specified object is null or itself if the specified object is not null.
    static short
    defaultIfNull(Short b, short defaultForNull)
    Returns the specified default value if the specified object is null or itself if the specified object is not null.
    static <T> T
    defaultIfNull(T obj, Supplier<? extends T> supplierForDefault)
    Returns the default value provided by specified Supplier if the specified object is null or itself if the specified object is not null.
    static <T> T
    defaultIfNull(T obj, T defaultForNull)
    Returns the specified default value if the given object is null, otherwise returns the object itself.
    static <T> T
    Returns the default value of the given class type.
    static boolean[]
    deleteAllByIndices(boolean[] a, int... indices)
    Returns a new array with elements copied from the specified array except the elements at the specified positions.
    static byte[]
    deleteAllByIndices(byte[] a, int... indices)
    Returns a new array with elements copied from the specified array except the elements at the specified positions.
    static char[]
    deleteAllByIndices(char[] a, int... indices)
    Returns a new array with elements copied from the specified array except the elements at the specified positions.
    static double[]
    deleteAllByIndices(double[] a, int... indices)
    Returns a new array with elements copied from the specified array except the elements at the specified positions.
    static float[]
    deleteAllByIndices(float[] a, int... indices)
    Returns a new array with elements copied from the specified array except the elements at the specified positions.
    static int[]
    deleteAllByIndices(int[] a, int... indices)
    Returns a new array with elements copied from the specified array except the elements at the specified positions.
    static long[]
    deleteAllByIndices(long[] a, int... indices)
    Returns a new array with elements copied from the specified array except the elements at the specified positions.
    static short[]
    deleteAllByIndices(short[] a, int... indices)
    Returns a new array with elements copied from the specified array except the elements at the specified positions.
    static String[]
    deleteAllByIndices(String[] a, int... indices)
    Returns a new array with elements copied from the specified array except the elements at the specified positions.
    static boolean
    deleteAllByIndices(List<?> list, int... indices)
    Deletes all elements at the specified positions from the given list.
    static <T> T[]
    deleteAllByIndices(T[] a, int... indices)
    Returns a new array with elements copied from the specified array except the elements at the specified positions.
    static boolean[]
    deleteByIndex(boolean[] a, int index)
    Returns a new array with elements copied from the specified array except the element at the specified position.
    static byte[]
    deleteByIndex(byte[] a, int index)
    Returns a new array with elements copied from the specified array except the element at the specified position.
    static char[]
    deleteByIndex(char[] a, int index)
    Returns a new array with elements copied from the specified array except the element at the specified position.
    static double[]
    deleteByIndex(double[] a, int index)
    Returns a new array with elements copied from the specified array except the element at the specified position.
    static float[]
    deleteByIndex(float[] a, int index)
    Returns a new array with elements copied from the specified array except the element at the specified position.
    static int[]
    deleteByIndex(int[] a, int index)
    Returns a new array with elements copied from the specified array except the element at the specified position.
    static long[]
    deleteByIndex(long[] a, int index)
    Returns a new array with elements copied from the specified array except the element at the specified position.
    static short[]
    deleteByIndex(short[] a, int index)
    Returns a new array with elements copied from the specified array except the element at the specified position.
    static <T> T[]
    deleteByIndex(T[] a, int index)
    Returns a new array with elements copied from the specified array except the element at the specified position.
    static boolean[]
    deleteRange(boolean[] a, int fromIndex, int toIndex)
    Returns a new array with the specified range of elements removed
    The original array remains unchanged.
    static byte[]
    deleteRange(byte[] a, int fromIndex, int toIndex)
    Returns a new array with the specified range of elements removed
    The original array remains unchanged.
    static char[]
    deleteRange(char[] a, int fromIndex, int toIndex)
    Returns a new array with the specified range of elements removed
    The original array remains unchanged.
    static double[]
    deleteRange(double[] a, int fromIndex, int toIndex)
    Returns a new array with the specified range of elements removed
    The original array remains unchanged.
    static float[]
    deleteRange(float[] a, int fromIndex, int toIndex)
    Returns a new array with the specified range of elements removed
    The original array remains unchanged.
    static int[]
    deleteRange(int[] a, int fromIndex, int toIndex)
    Returns a new array with the specified range of elements removed
    The original array remains unchanged.
    static long[]
    deleteRange(long[] a, int fromIndex, int toIndex)
    Returns a new array with the specified range of elements removed
    The original array remains unchanged.
    static short[]
    deleteRange(short[] a, int fromIndex, int toIndex)
    Returns a new array with the specified range of elements removed
    The original array remains unchanged.
    static String[]
    deleteRange(String[] a, int fromIndex, int toIndex)
    Returns a new array with the specified range of elements removed
    The original array remains unchanged.
    static String
    deleteRange(String str, int fromIndex, int toIndex)
    Returns a new String with the specified range of chars removed
    The original String remains unchanged.
    static <T> boolean
    deleteRange(List<T> c, int fromIndex, int toIndex)
    Deletes a range of elements from the given list.
    static <T> T[]
    deleteRange(T[] a, int fromIndex, int toIndex)
    Returns a new array with the specified range of elements removed
    The original array remains unchanged.
    static boolean[]
    difference(boolean[] a, boolean[] b)
    Returns the elements in the specified boolean array a but not present in the boolean array b.
    static byte[]
    difference(byte[] a, byte[] b)
    Returns the elements in the specified byte array a but not present in the byte array b.
    static char[]
    difference(char[] a, char[] b)
    Returns the elements in the specified char array a but not present in the char array b.
    static double[]
    difference(double[] a, double[] b)
    Returns the elements in the specified double array a but not present in the double array b.
    static float[]
    difference(float[] a, float[] b)
    Returns the elements in the specified float array a but not present in the float array b.
    static int[]
    difference(int[] a, int[] b)
    Returns the elements in the specified int array a but not present in the int array b.
    static long[]
    difference(long[] a, long[] b)
    Returns the elements in the specified long array a but not present in the long array b.
    static short[]
    difference(short[] a, short[] b)
    Returns the elements in the specified short array a but not present in the short array b.
    static <T> List<T>
    difference(Collection<? extends T> a, Collection<?> b)
    Returns the elements in the specified collections a but not present in the specified collection b.
    static <T> List<T>
    difference(T[] a, Object[] b)
    Returns the elements in the specified arrays a but not present in the specified array b.
    static boolean
    disjoint(Object[] a, Object[] b)
    Checks if the two specified arrays have no elements in common.
    static boolean
    Checks if the two specified collections have no elements in common.
    static boolean[]
    distinct(boolean[] a)
    Returns a new array containing only the distinct elements from the specified array.
    static boolean[]
    distinct(boolean[] a, int fromIndex, int toIndex)
    Returns a new array containing only the distinct elements from the specified range in the input array.
    static byte[]
    distinct(byte[] a)
    Returns a new array containing only the distinct elements from the specified array.
    static byte[]
    distinct(byte[] a, int fromIndex, int toIndex)
    Returns a new array containing only the distinct elements from the specified range in the input array.
    static char[]
    distinct(char[] a)
    Returns a new array containing only the distinct elements from the specified array.
    static char[]
    distinct(char[] a, int fromIndex, int toIndex)
    Returns a new array containing only the distinct elements from the specified range in the input array.
    static double[]
    distinct(double[] a)
    Returns a new array containing only the distinct elements from the specified array.
    static double[]
    distinct(double[] a, int fromIndex, int toIndex)
    Returns a new array containing only the distinct elements from the specified range in the input array.
    static float[]
    distinct(float[] a)
    Returns a new array containing only the distinct elements from the specified array.
    static float[]
    distinct(float[] a, int fromIndex, int toIndex)
    Returns a new array containing only the distinct elements from the specified range in the input array.
    static int[]
    distinct(int[] a)
    Returns a new array containing only the distinct elements from the specified array.
    static int[]
    distinct(int[] a, int fromIndex, int toIndex)
    Returns a new array containing only the distinct elements from the specified range in the input array.
    static long[]
    distinct(long[] a)
    Returns a new array containing only the distinct elements from the specified array.
    static long[]
    distinct(long[] a, int fromIndex, int toIndex)
    Returns a new array containing only the distinct elements from the specified range in the input array.
    static short[]
    distinct(short[] a)
    Returns a new array containing only the distinct elements from the specified array.
    static short[]
    distinct(short[] a, int fromIndex, int toIndex)
    Returns a new array containing only the distinct elements from the specified range in the input array.
    static <T> List<T>
    distinct(Iterable<? extends T> c)
    Returns a new list containing only the distinct elements from the specified iterable.
    static <T> List<T>
    distinct(Collection<? extends T> c, int fromIndex, int toIndex)
    Returns a new list containing only the distinct elements from the specified range in the input collection.
    static <T> List<T>
    distinct(Iterator<? extends T> iter)
    Returns a new list containing only the distinct elements from the specified iterator.
    static <T> List<T>
    distinct(T[] a)
    Returns a new list containing only the distinct elements from the specified array.
    static <T> List<T>
    distinct(T[] a, int fromIndex, int toIndex)
    Returns a new list containing only the distinct elements from the specified range in the input array.
    static <T> List<T>
    distinctBy(Iterable<? extends T> c, Function<? super T,?> keyExtractor)
    Returns a new list containing only the distinct elements from the specified iterable, where distinctness is determined by the keys extracted by the specified Function<T, K>.
    static <T, C extends Collection<T>>
    C
    distinctBy(Iterable<? extends T> c, Function<? super T,?> keyExtractor, Supplier<C> supplier)
    Returns a new collection containing only the distinct elements from the specified iterable, where distinctness is determined by the keys extracted by the specified Function<T, K>.
    static <T> List<T>
    distinctBy(Collection<? extends T> c, int fromIndex, int toIndex, Function<? super T,?> keyExtractor)
    Returns a new list containing only the distinct elements from the specified range in the input collection, where distinctness is determined by the keys extracted by the specified Function<T, K>.
    static <T> List<T>
    distinctBy(Iterator<? extends T> iter, Function<? super T,?> keyExtractor)
    Returns a new list containing only the distinct elements from the specified iterator, where distinctness is determined by the keys extracted by the specified Function<T, K>.
    static <T, C extends Collection<T>>
    C
    distinctBy(Iterator<? extends T> iter, Function<? super T,?> keyExtractor, Supplier<C> supplier)
    Returns a new collection containing only the distinct elements from the specified iterator, where distinctness is determined by the keys extracted by the specified Function<T, K>.
    static <T> List<T>
    distinctBy(T[] a, int fromIndex, int toIndex, Function<? super T,?> keyExtractor)
    Returns a new list containing only the distinct elements from the specified range in the input array, where distinctness is determined by the keys extracted by the specified Function<T, K>.
    static <T> List<T>
    distinctBy(T[] a, Function<? super T,?> keyExtractor)
    Returns a new list containing only the distinct elements from the specified array, where distinctness is determined by the keys extracted by the specified Function<T, K>.
    static <T, C extends Collection<T>>
    C
    distinctBy(T[] a, Function<? super T,?> keyExtractor, Supplier<C> supplier)
    Returns a new collection containing only the distinct elements from the specified array, where distinctness is determined by the keys extracted by the specified Function<T, K>.
    static <T> List<T>
    dropWhile(Iterable<? extends T> c, Predicate<? super T> filter)
    Returns a list containing the elements of the input iterable after dropping the elements that satisfy the provided predicate.
    static <T> List<T>
    dropWhile(Iterator<? extends T> iter, Predicate<? super T> filter)
    Returns a list containing the elements of the input iterator after dropping the elements that satisfy the provided predicate.
    static <T> List<T>
    dropWhile(T[] a, Predicate<? super T> filter)
    Returns a list containing the elements of the input array after dropping the elements that satisfy the provided predicate.
    static DataSet
    Returns an immutable/unmodifiable empty DataSet.
    Returns an immutable/unmodifiable empty InputStream.
    static <T> Iterator<T>
    Returns an immutable/unmodifiable empty iterator.
    static <T> List<T>
    Returns an immutable/unmodifiable empty List.
    static <T> ListIterator<T>
    Returns an immutable/unmodifiable empty ListIterator.
    static <K, V> Map<K,V>
    Returns an immutable/unmodifiable empty Map.
    static <K, V> NavigableMap<K,V>
    Returns an immutable/unmodifiable empty NavigableMap.
    static <T> NavigableSet<T>
    Returns an immutable/unmodifiable empty NavigableSet.
    static <T> Set<T>
    Returns an immutable/unmodifiable empty Set.
    static <K, V> SortedMap<K,V>
    Returns an immutable/unmodifiable empty SortedMap.
    static <T> SortedSet<T>
    Returns an immutable/unmodifiable empty SortedSet.
    static <E extends Enum<E>>
    ImmutableList<E>
    enumListOf(Class<E> enumClass)
    Returns an immutable/unmodifiable list of all the enum constants in the specified enum class.
    static <E extends Enum<E>>
    ImmutableBiMap<E,String>
    enumMapOf(Class<E> enumClass)
    Returns an immutable/unmodifiable bi-directional map of all the enum constants in the specified enum class to their names.
    static <E extends Enum<E>>
    ImmutableSet<E>
    enumSetOf(Class<E> enumClass)
    Returns an immutable/unmodifiable set of all the enum constants in the specified enum class.
    static boolean
    equals(boolean[] a, boolean[] b)
    Compares two arrays for equality.
    static boolean
    equals(boolean[] a, int fromIndexA, boolean[] b, int fromIndexB, int len)
    Compares two boolean arrays for equality within the specified range.
    static boolean
    equals(boolean a, boolean b)
    Compares two boolean values for equality.
    static boolean
    equals(byte[] a, byte[] b)
    Compares two arrays for equality.
    static boolean
    equals(byte[] a, int fromIndexA, byte[] b, int fromIndexB, int len)
    Compares two byte arrays for equality within the specified range.
    static boolean
    equals(byte a, byte b)
    Compares two byte values for equality.
    static boolean
    equals(char[] a, char[] b)
    Compares two arrays for equality.
    static boolean
    equals(char[] a, int fromIndexA, char[] b, int fromIndexB, int len)
    Compares two char arrays for equality within the specified range.
    static boolean
    equals(char a, char b)
    Compares two char values for equality.
    static boolean
    equals(double[] a, double[] b)
    Compares two arrays for equality.
    static boolean
    equals(double[] a, int fromIndexA, double[] b, int fromIndexB, int len)
    Compares two double arrays for equality within the specified range.
    static boolean
    equals(double a, double b)
    Compares two double values for equality.
    static boolean
    equals(float[] a, float[] b)
    Compares two arrays for equality.
    static boolean
    equals(float[] a, int fromIndexA, float[] b, int fromIndexB, int len)
    Compares two float arrays for equality within the specified range.
    static boolean
    equals(float a, float b)
    Compares two float values for equality.
    static boolean
    equals(int[] a, int[] b)
    Compares two arrays for equality.
    static boolean
    equals(int[] a, int fromIndexA, int[] b, int fromIndexB, int len)
    Compares two int arrays for equality within the specified range.
    static boolean
    equals(int a, int b)
    Compares two int values for equality.
    static boolean
    equals(long[] a, int fromIndexA, long[] b, int fromIndexB, int len)
    Compares two long arrays for equality within the specified range.
    static boolean
    equals(long[] a, long[] b)
    Compares two arrays for equality.
    static boolean
    equals(long a, long b)
    Compares two long values for equality.
    static boolean
    equals(short[] a, int fromIndexA, short[] b, int fromIndexB, int len)
    Compares two short arrays for equality within the specified range.
    static boolean
    equals(short[] a, short[] b)
    Compares two arrays for equality.
    static boolean
    equals(short a, short b)
    Compares two short values for equality.
    static boolean
    equals(Object[] a, int fromIndexA, Object[] b, int fromIndexB, int len)
    Compares two arrays for equality within the specified range.
    static boolean
    equals(Object[] a, Object[] b)
    Compares two arrays for equality.
    static boolean
    Compares two objects for equality.
    static boolean
    Compares two strings for equality.
    static boolean
    Compares the properties of two beans to determine if they are equal.
    static boolean
    equalsByProps(Object bean1, Object bean2, Collection<String> propNamesToCompare)
    Compares the specified properties of two beans to determine if they are equal.
    static boolean
    equalsIgnoreCase(String[] a, int fromIndexA, String[] b, int fromIndexB, int len)
    Compares two arrays of Strings, ignoring case considerations, within the specified range.
    static boolean
    Compares two arrays of Strings, ignoring case considerations.
    static boolean
    Compares two strings for equality, ignoring case.
    static void
    erase(Object bean, String... propNames)
    Erases the properties of the given bean object.
    static void
    erase(Object bean, Collection<String> propNames)
    Erases the properties of the given bean object.
    static void
    Erases all the properties of the given bean object.
    static <T> List<T>
    exclude(Collection<? extends T> c, Object objToExclude)
    Returns a new List containing all the elements from the specified collection except all occurrences of specified objToExclude.
    static <T> List<T>
    excludeAll(Collection<? extends T> c, Collection<?> objsToExclude)
    Returns a new List containing all the elements from the specified collection except all occurrences of elements in the specified objsToExclude.
    static <T> Set<T>
    excludeAllToSet(Collection<? extends T> c, Collection<?> objsToExclude)
    Returns a new Set containing all the elements from the specified collection except all occurrences of elements in the specified objsToExclude.
    static <T> Set<T>
    excludeToSet(Collection<? extends T> c, Object objToExclude)
    Returns a new Set containing all the elements from the specified collection except all occurrences of specified objToExclude.
    static void
    execute(Throwables.Runnable<? extends Exception> cmd, int retryTimes, long retryIntervallInMillis, Predicate<? super Exception> retryCondition)
    Executes the provided command with the specified retry logic in case of failure.
    static <R> R
    execute(Callable<R> cmd, int retryTimes, long retryIntervallInMillis, BiPredicate<? super R,? super Exception> retryCondition)
    Executes the provided command with the specified retry logic in case of failure.
    static void
    fill(boolean[] a, boolean val)
    Fills the specified boolean array with the specified value.
    static void
    fill(boolean[] a, int fromIndex, int toIndex, boolean val)
    Fills the specified boolean array with the specified value from the specified fromIndex (inclusive) to the specified toIndex (exclusive).
    static void
    fill(byte[] a, byte val)
    Fills the specified byte array with the specified value.
    static void
    fill(byte[] a, int fromIndex, int toIndex, byte val)
    Fills the specified byte array with the specified value from the specified fromIndex (inclusive) to the specified toIndex (exclusive).
    static void
    fill(char[] a, char val)
    Fills the specified char array with the specified value.
    static void
    fill(char[] a, int fromIndex, int toIndex, char val)
    Fills the specified char array with the specified value from the specified fromIndex (inclusive) to the specified toIndex (exclusive).
    static void
    fill(double[] a, double val)
    Fills the specified double array with the specified value.
    static void
    fill(double[] a, int fromIndex, int toIndex, double val)
    Fills the specified double array with the specified value from the specified fromIndex (inclusive) to the specified toIndex (exclusive).
    static void
    fill(float[] a, float val)
    Fills the specified float array with the specified value.
    static void
    fill(float[] a, int fromIndex, int toIndex, float val)
    Fills the specified float array with the specified value from the specified fromIndex (inclusive) to the specified toIndex (exclusive).
    static void
    fill(int[] a, int val)
    Fills the specified int array with the specified value.
    static void
    fill(int[] a, int fromIndex, int toIndex, int val)
    Fills the specified int array with the specified value from the specified fromIndex (inclusive) to the specified toIndex (exclusive).
    static void
    fill(long[] a, int fromIndex, int toIndex, long val)
    Fills the specified long array with the specified value from the specified fromIndex (inclusive) to the specified toIndex (exclusive).
    static void
    fill(long[] a, long val)
    Fills the specified long array with the specified value.
    static void
    fill(short[] a, int fromIndex, int toIndex, short val)
    Fills the specified short array with the specified value from the specified fromIndex (inclusive) to the specified toIndex (exclusive).
    static void
    fill(short[] a, short val)
    Fills the specified short array with the specified value.
    static <T> T
    fill(Class<? extends T> beanClass)
    Fills the properties of a new instance of the specified bean class with random values.
    static <T> List<T>
    fill(Class<? extends T> beanClass, int count)
    Returns a list of new instances of the specified bean class with properties filled with random values.
    static void
    fill(Object bean)
    Fills the properties of the specified bean with random values.
    static void
    fill(Object[] a, int fromIndex, int toIndex, Object val)
    Fills the specified Object array with the specified value from the specified fromIndex (inclusive) to the specified toIndex (exclusive).
    static void
    fill(Object[] a, Object val)
    Fills the specified Object array with the specified value.
    static <T> void
    fill(List<? super T> list, int fromIndex, int toIndex, T val)
    Fills the specified list with the specified value from the specified start index to the specified end index.
    static <T> void
    fill(List<? super T> list, T val)
    Fills the specified list with the specified value.
    static boolean[]
    filter(boolean[] a, int fromIndex, int toIndex, BooleanPredicate filter)
    Returns a new array containing only the elements that match the filter predicate within the specified range in the input array.
    static boolean[]
    filter(boolean[] a, BooleanPredicate filter)
    Returns a new array containing only the elements that match the filter predicate.
    static byte[]
    filter(byte[] a, int fromIndex, int toIndex, BytePredicate filter)
    Returns a new array containing only the elements that match the filter predicate within the specified range in the input array.
    static byte[]
    filter(byte[] a, BytePredicate filter)
    Returns a new array containing only the elements that match the filter predicate.
    static char[]
    filter(char[] a, int fromIndex, int toIndex, CharPredicate filter)
    Returns a new array containing only the elements that match the filter predicate within the specified range in the input array.
    static char[]
    filter(char[] a, CharPredicate filter)
    Returns a new array containing only the elements that match the filter predicate.
    static double[]
    filter(double[] a, int fromIndex, int toIndex, DoublePredicate filter)
    Returns a new array containing only the elements that match the filter predicate within the specified range in the input array.
    static double[]
    filter(double[] a, DoublePredicate filter)
    Returns a new array containing only the elements that match the filter predicate.
    static float[]
    filter(float[] a, int fromIndex, int toIndex, FloatPredicate filter)
    Returns a new array containing only the elements that match the filter predicate within the specified range in the input array.
    static float[]
    filter(float[] a, FloatPredicate filter)
    Returns a new array containing only the elements that match the filter predicate.
    static int[]
    filter(int[] a, int fromIndex, int toIndex, IntPredicate filter)
    Returns a new array containing only the elements that match the filter predicate within the specified range in the input array.
    static int[]
    filter(int[] a, IntPredicate filter)
    Returns a new array containing only the elements that match the filter predicate.
    static long[]
    filter(long[] a, int fromIndex, int toIndex, LongPredicate filter)
    Returns a new array containing only the elements that match the filter predicate within the specified range in the input array.
    static long[]
    filter(long[] a, LongPredicate filter)
    Returns a new array containing only the elements that match the filter predicate.
    static short[]
    filter(short[] a, int fromIndex, int toIndex, ShortPredicate filter)
    Returns a new array containing only the elements that match the filter predicate within the specified range in the input array.
    static short[]
    filter(short[] a, ShortPredicate filter)
    Returns a new array containing only the elements that match the filter predicate.
    static <T> List<T>
    filter(Iterable<? extends T> c, Predicate<? super T> filter)
    Returns a new list containing only the elements that match the filter predicate.
    static <T, C extends Collection<T>>
    C
    filter(Iterable<? extends T> c, Predicate<? super T> filter, IntFunction<C> supplier)
    Returns a new collection containing only the elements that match the filter predicate.
    static <T> List<T>
    filter(Collection<? extends T> c, int fromIndex, int toIndex, Predicate<? super T> filter)
    Returns a new list containing only the elements that match the filter predicate within the specified range in the input collection.
    static <T, C extends Collection<T>>
    C
    filter(Collection<? extends T> c, int fromIndex, int toIndex, Predicate<? super T> filter, IntFunction<C> supplier)
    Returns a new collection containing only the elements that match the filter predicate within the specified range in the input collection.
    static <T> List<T>
    filter(Iterator<? extends T> iter, Predicate<? super T> filter)
    Returns a new list containing only the elements that match the filter predicate.
    static <T, C extends Collection<T>>
    C
    filter(Iterator<? extends T> iter, Predicate<? super T> filter, IntFunction<C> supplier)
    Returns a new collection containing only the elements that match the filter predicate.
    static <T> List<T>
    filter(T[] a, int fromIndex, int toIndex, Predicate<? super T> filter)
    Returns a new list containing only the elements that match the filter predicate within the specified range in the input array.
    static <T, C extends Collection<T>>
    C
    filter(T[] a, int fromIndex, int toIndex, Predicate<? super T> filter, IntFunction<C> supplier)
    Returns a new collection containing only the elements that match the filter predicate within the specified range in the input array.
    static <T> List<T>
    filter(T[] a, Predicate<? super T> filter)
    Returns a new list containing only the elements that match the filter predicate.
    static <T, C extends Collection<T>>
    C
    filter(T[] a, Predicate<? super T> filter, IntFunction<C> supplier)
    Returns a new collection containing only the elements that match the filter predicate.
    static <T, R> List<R>
    filterAndFlatMap(Iterable<? extends T> c, Predicate<? super T> filter, Function<? super T,? extends Collection<? extends R>> mapper)
    Filters and flat-maps the elements in the given iterable.
    static <T, R, C extends Collection<R>>
    C
    filterAndFlatMap(Iterable<? extends T> c, Predicate<? super T> filter, Function<? super T,? extends Collection<? extends R>> mapper, IntFunction<C> supplier)
    Filters and flat-maps the elements in the given iterable.
    static <T, R> List<R>
    filterAndMap(Iterable<? extends T> c, Predicate<? super T> filter, Function<? super T,? extends R> mapper)
    Filters and maps the elements in the given iterable.
    static <T, R, C extends Collection<R>>
    C
    filterAndMap(Iterable<? extends T> c, Predicate<? super T> filter, Function<? super T,? extends R> mapper, IntFunction<C> supplier)
    Filters and maps the elements in the given iterable.
    static <T> u.Nullable<T>
    findFirst(Iterable<? extends T> c, Predicate<? super T> predicate)
    Returns the first element in the given iterable that matches the specified predicate.
    static <T> u.Nullable<T>
    findFirst(Iterator<? extends T> iter, Predicate<? super T> predicate)
    Returns the first element in the given iterator that matches the specified predicate.
    static <T> u.Nullable<T>
    findFirst(T[] a, Predicate<? super T> predicate)
    Returns the first element in the given array that matches the specified predicate.
    static <T> u.OptionalInt
    findFirstIndex(Collection<? extends T> c, Predicate<? super T> predicate)
    Finds the index of the first element in the collection that matches the given predicate.
    static <T, U> u.OptionalInt
    findFirstIndex(Collection<? extends T> c, U u, BiPredicate<? super T,? super U> predicate)
    Finds the index of the first element in the collection that matches the given predicate.
    static <T> u.OptionalInt
    findFirstIndex(T[] a, Predicate<? super T> predicate)
    Finds the index of the first element in the array that matches the given predicate.
    static <T, U> u.OptionalInt
    findFirstIndex(T[] a, U u, BiPredicate<? super T,? super U> predicate)
    Finds the index of the first element in the array that matches the given predicate.
    static <T> u.Optional<T>
    findFirstNonNull(Iterable<? extends T> c, Predicate<? super T> predicate)
    Returns the first non-null element in the given iterable that matches the specified predicate.
    static <T> u.Optional<T>
    findFirstNonNull(Iterator<? extends T> iter, Predicate<? super T> predicate)
    Returns the first non-null element in the given iterator that matches the specified predicate.
    static <T> u.Optional<T>
    findFirstNonNull(T[] a, Predicate<? super T> predicate)
    Returns the first non-null element in the given array that matches the specified predicate.
    static <T> u.Nullable<T>
    findLast(Iterable<? extends T> c, Predicate<? super T> predicate)
    Returns the last element in the given iterable that matches the specified predicate.
    static <T> u.Nullable<T>
    findLast(T[] a, Predicate<? super T> predicate)
    Returns the last element in the given array that matches the specified predicate.
    static <T> u.OptionalInt
    findLastIndex(Collection<? extends T> c, Predicate<? super T> predicate)
    Finds the index of the last element in the collection that matches the given predicate.
    static <T, U> u.OptionalInt
    findLastIndex(Collection<? extends T> c, U u, BiPredicate<? super T,? super U> predicate)
    Finds the index of the last element in the collection that matches the given predicate.
    static <T> u.OptionalInt
    findLastIndex(T[] a, Predicate<? super T> predicate)
    Finds the index of the last element in the array that matches the given predicate.
    static <T, U> u.OptionalInt
    findLastIndex(T[] a, U u, BiPredicate<? super T,? super U> predicate)
    Finds the index of the last element in the array that matches the given predicate.
    static <T> u.Optional<T>
    findLastNonNull(Iterable<? extends T> c, Predicate<? super T> predicate)
    Returns the last non-null element in the given iterable that matches the specified predicate.
    static <T> u.Optional<T>
    findLastNonNull(T[] a, Predicate<? super T> predicate)
    Returns the last non-null element in the given array that matches the specified predicate.
    static <T> u.Nullable<T>
    firstElement(Iterable<? extends T> c)
    Returns the first element in the given Iterable wrapped in a Nullable.
    static <T> u.Nullable<T>
    firstElement(Iterator<? extends T> iter)
    Returns the first element in the given Iterator wrapped in a Nullable.
    static <T> List<T>
    firstElements(Iterable<? extends T> c, int n)
    Returns a list containing the first n elements from the given Iterable.
    static <T> List<T>
    firstElements(Iterator<? extends T> iter, int n)
    Returns a list containing the first n elements from the given Iterator.
    static <K, V> u.Optional<Map.Entry<K,V>>
    firstEntry(Map<K,V> map)
    Returns the first entry from the given map.
    static <T extends CharSequence>
    u.Optional<T>
    firstNonBlank(T... a)
    Returns the first non-blank CharSequence from the given CharSequences.
    static <T extends CharSequence>
    u.Optional<T>
    firstNonBlank(T a, T b)
    Returns the first non-blank CharSequence from the given CharSequences.
    static <T extends CharSequence>
    u.Optional<T>
    firstNonBlank(T a, T b, T c)
    Returns the first non-blank CharSequence from the given CharSequences.
    static <T extends CharSequence>
    u.Optional<T>
    firstNonEmpty(T... a)
    Returns the first non-empty CharSequence from the given CharSequences.
    static <T> u.Optional<T[]>
    firstNonEmpty(T[] a, T[] b)
    Returns the first non-empty array from the given arrays.
    static <T> u.Optional<T[]>
    firstNonEmpty(T[] a, T[] b, T[] c)
    Returns the first non-empty array from the given arrays.
    static <T extends Collection<?>>
    u.Optional<T>
    firstNonEmpty(T a, T b)
    Returns the first non-empty collection from the given collections.
    static <T extends Collection<?>>
    u.Optional<T>
    firstNonEmpty(T a, T b, T c)
    Returns the first non-empty collection from the given collections.
    static <T> u.Optional<T>
    firstNonNull(Iterable<? extends T> c)
    Returns the first non-null value from the provided iterable.
    static <T> u.Optional<T>
    firstNonNull(Iterator<? extends T> iter)
    Returns the first non-null value from the provided iterator.
    static <T> u.Optional<T>
    firstNonNull(T... a)
    Returns the first non-null value among the provided values.
    static <T> u.Optional<T>
    firstNonNull(T a, T b)
    Returns the first non-null value among the two provided values.
    static <T> u.Optional<T>
    firstNonNull(T a, T b, T c)
    Returns the first non-null value among the three provided values.
    static <T> T
    firstOrDefaultIfEmpty(Iterable<? extends T> c, T defaultValueForEmpty)
    Returns the first element of the given iterable if it is not empty, otherwise returns the specified default value.
    static <T> T
    firstOrDefaultIfEmpty(Iterator<? extends T> iter, T defaultValueForEmpty)
    Returns the first element of the given iterator if it is not empty, otherwise returns the specified default value.
    static <T> T
    firstOrDefaultIfEmpty(T[] a, T defaultValueForEmpty)
    Returns the first element of the given array if it is not empty, otherwise returns the specified default value.
    static <T> T
    firstOrNullIfEmpty(Iterable<? extends T> c)
    Returns the first element of the given iterable if it is not empty, otherwise returns null.
    static <T> T
    firstOrNullIfEmpty(Iterator<? extends T> iter)
    Returns the first element of the given iterator if it is not empty, otherwise returns null.
    static <T> T
    Returns the first element of the given array if it is not empty, otherwise returns null.
    static <T, R> List<R>
    flatMap(Iterable<? extends T> c, Function<? super T,? extends Collection<? extends R>> mapper)
    Transforms the elements in the specified iterable from type: {code T} to a collection of type: R by applying the specified Function<T, Collection<R>> to each element.
    static <T, R, C extends Collection<R>>
    C
    flatMap(Iterable<? extends T> c, Function<? super T,? extends Collection<? extends R>> mapper, IntFunction<? extends C> supplier)
    Transforms the elements in the specified iterable from type: {code T} to a collection of type: R by applying the specified Function<T, Collection<R>> to each element.
    static <T, U, R> List<R>
    flatMap(Iterable<? extends T> c, Function<? super T,? extends Collection<? extends U>> mapper, Function<? super U,? extends Collection<? extends R>> mapper2)
    Transforms the elements in the specified iterable from type T to a collection of type R by applying the specified Function<T, Collection<U>> to each element, and then applying the specified Function<U, Collection<R>> to each element in the intermediate collections.
    static <T, U, R, C extends Collection<R>>
    C
    flatMap(Iterable<? extends T> c, Function<? super T,? extends Collection<? extends U>> mapper, Function<? super U,? extends Collection<? extends R>> mapper2, IntFunction<? extends C> supplier)
    Transforms the elements in the specified iterable from type T to a collection of type R by applying the specified Function<T, Collection<U>> to each element, and then applying the specified Function<U, Collection<R>> to each element in the intermediate collections.
    static <T, R> List<R>
    flatMap(Collection<? extends T> c, int fromIndex, int toIndex, Function<? super T,? extends Collection<? extends R>> mapper)
    Transforms the elements within the specified range in the input collection from type: {code T} to a collection of type: R by applying the specified Function<T, Collection<R>> to each element.
    static <T, R, C extends Collection<R>>
    C
    flatMap(Collection<? extends T> c, int fromIndex, int toIndex, Function<? super T,? extends Collection<? extends R>> mapper, IntFunction<? extends C> supplier)
    Transforms the elements within the specified range in the input collection from type: {code T} to a collection of type: R by applying the specified Function<T, Collection<R>> to each element.
    static <T, R> List<R>
    flatMap(Iterator<? extends T> iter, Function<? super T,? extends Collection<? extends R>> mapper)
    Transforms the elements in the specified iterator from type: {code T} to a collection of type: R by applying the specified Function<T, Collection<R>> to each element.
    static <T, R, C extends Collection<R>>
    C
    flatMap(Iterator<? extends T> iter, Function<? super T,? extends Collection<? extends R>> mapper, IntFunction<? extends C> supplier)
    Transforms the elements in the specified iterator from type: {code T} to a collection of type: R by applying the specified Function<T, Collection<R>> to each element.
    static <T, U, R> List<R>
    flatMap(Iterator<? extends T> iter, Function<? super T,? extends Collection<? extends U>> mapper, Function<? super U,? extends Collection<? extends R>> mapper2)
    Transforms the elements in the specified iterator from type T to a collection of type R by applying the specified Function<T, Collection<U>> to each element, and then applying the specified Function<U, Collection<R>> to each element in the intermediate collections.
    static <T, U, R, C extends Collection<R>>
    C
    flatMap(Iterator<? extends T> iter, Function<? super T,? extends Collection<? extends U>> mapper, Function<? super U,? extends Collection<? extends R>> mapper2, IntFunction<? extends C> supplier)
    Transforms the elements in the specified iterator from type T to a collection of type R by applying the specified Function<T, Collection<U>> to each element, and then applying the specified Function<U, Collection<R>> to each element in the intermediate collections.
    static <T, R> List<R>
    flatMap(T[] a, int fromIndex, int toIndex, Function<? super T,? extends Collection<? extends R>> mapper)
    Transforms the elements within the specified range in the input array from type: {code T} to a collection of type: R by applying the specified Function<T, Collection<R>> to each element.
    static <T, R, C extends Collection<R>>
    C
    flatMap(T[] a, int fromIndex, int toIndex, Function<? super T,? extends Collection<? extends R>> mapper, IntFunction<? extends C> supplier)
    Transforms the elements within the specified range in the input array from type: {code T} to a collection of type: R by applying the specified Function<T, Collection<R>> to each element.
    static <T, R> List<R>
    flatMap(T[] a, Function<? super T,? extends Collection<? extends R>> mapper)
    Transforms the elements in the specified array from type: {code T} to a collection of type: R by applying the specified Function<T, Collection<R>> to each element.
    static <T, R, C extends Collection<R>>
    C
    flatMap(T[] a, Function<? super T,? extends Collection<? extends R>> mapper, IntFunction<? extends C> supplier)
    Transforms the elements in the specified array from type: {code T} to a collection of type: R by applying the specified Function<T, Collection<R>> to each element.
    static <T, U, R> List<R>
    flatMap(T[] a, Function<? super T,? extends Collection<? extends U>> mapper, Function<? super U,? extends Collection<? extends R>> mapper2)
    Transforms the elements in the specified array from type T to a collection of type R by applying the specified Function<T, Collection<U>> to each element, and then applying the specified Function<U, Collection<R>> to each element in the intermediate collections.
    static <T, U, R, C extends Collection<R>>
    C
    flatMap(T[] a, Function<? super T,? extends Collection<? extends U>> mapper, Function<? super U,? extends Collection<? extends R>> mapper2, IntFunction<? extends C> supplier)
    Transforms the elements in the specified array from type T to a collection of type R by applying the specified Function<T, Collection<U>> to each element, and then applying the specified Function<U, Collection<R>> to each element in the intermediate collections.
    static <T, R> List<R>
    flatMapAndFilter(Iterable<? extends T> c, Function<? super T,? extends Collection<? extends R>> mapper, Predicate<? super R> filter)
    Flat-maps and filters the elements in the given iterable.
    static <T, R, C extends Collection<R>>
    C
    flatMapAndFilter(Iterable<? extends T> c, Function<? super T,? extends Collection<? extends R>> mapper, Predicate<? super R> filter, IntFunction<? extends C> supplier)
    Flat-maps and filters the elements in the given iterable.
    static boolean[]
    flatten(boolean[][] a)
    Flattens a two-dimensional boolean array into a one-dimensional boolean array.
    static byte[]
    flatten(byte[][] a)
    Flattens a two-dimensional byte array into a one-dimensional byte array.
    static char[]
    flatten(char[][] a)
    Flattens a two-dimensional char array into a one-dimensional char array.
    static double[]
    flatten(double[][] a)
    Flattens a two-dimensional double array into a one-dimensional double array.
    static float[]
    flatten(float[][] a)
    Flattens a two-dimensional float array into a one-dimensional float array.
    static int[]
    flatten(int[][] a)
    Flattens a two-dimensional int array into a one-dimensional int array.
    static long[]
    flatten(long[][] a)
    Flattens a two-dimensional long array into a one-dimensional long array.
    static short[]
    flatten(short[][] a)
    Flattens a two-dimensional short array into a one-dimensional short array.
    static <T> List<T>
    flatten(Iterable<? extends Iterable<? extends T>> c)
    Flattens an Iterable of Iterable<T> into a one-dimensional List.
    static <T, C extends Collection<T>>
    C
    flatten(Iterable<? extends Iterable<? extends T>> c, IntFunction<? extends C> supplier)
    Flattens an Iterable of Iterable<T> into a one-dimensional Collection.
    static <T> ObjIterator<T>
    flatten(Iterator<? extends Iterator<? extends T>> iters)
    Flattens an Iterator of Iterator<T> into a one-dimensional Iterator.
    static <T> T[]
    flatten(T[][] a)
    Flattens a two-dimensional array into a one-dimensional array.
    static <T> T[]
    flatten(T[][] a, Class<T> componentType)
    Flattens a two-dimensional array into a one-dimensional array.
    static List<?>
    Flattens each element of the provided Iterable if it's an Iterable itself, otherwise just adds it to the result List.
    static <T, C extends Collection<T>>
    C
    flattenEachElement(Iterable<?> c, Supplier<? extends C> supplier)
    Flattens each element of the provided Iterable if it's an Iterable itself, otherwise just adds it to the result Collection.
    static <E extends Exception>
    void
    forEach(int startInclusive, int endExclusive, int step, Throwables.IntConsumer<E> action)
    Executes the provided action for each value in the range defined by startInclusive, endExclusive and step.
    static <E extends Exception>
    void
    forEach(int startInclusive, int endExclusive, int step, Throwables.Runnable<E> action)
    Executes the provided action for each value in the range defined by startInclusive, endExclusive and step.
    static <T, E extends Exception>
    void
    forEach(int startInclusive, int endExclusive, int step, T a, Throwables.IntObjConsumer<? super T,E> action)
    Executes the provided action for each value in the range defined by startInclusive, endExclusive and step, passing the current index and the provided object a to the action.
    static <E extends Exception>
    void
    forEach(int startInclusive, int endExclusive, Throwables.IntConsumer<E> action)
    Executes the provided action for each value in the range defined by startInclusive and endExclusive.
    static <E extends Exception>
    void
    forEach(int startInclusive, int endExclusive, Throwables.Runnable<E> action)
    Executes the provided action for each value in the range defined by startInclusive and endExclusive.
    static <T, E extends Exception>
    void
    forEach(int startInclusive, int endExclusive, T a, Throwables.IntObjConsumer<? super T,E> action)
    Executes the provided action for each value in the range defined by startInclusive and endExclusive, passing the current index and the provided object a to the action.
    static <A, B, E extends Exception>
    void
    forEach(A[] a, B[] b, A valueForNoneA, B valueForNoneB, Throwables.BiConsumer<? super A,? super B,E> action)
    Executes the provided action for each pair of elements from the given arrays until all elements from the longer array are processed.
    static <A, B, C, E extends Exception>
    void
    forEach(A[] a, B[] b, C[] c, A valueForNoneA, B valueForNoneB, C valueForNoneC, Throwables.TriConsumer<? super A,? super B,? super C,E> action)
    Executes the provided action for each triple of elements from the given arrays until all elements from the longest array are processed.
    static <A, B, C, E extends Exception>
    void
    forEach(A[] a, B[] b, C[] c, Throwables.TriConsumer<? super A,? super B,? super C,E> action)
    Executes the provided action for each triple of elements from the given arrays until all elements from the shortest array are processed.
    static <A, B, E extends Exception>
    void
    forEach(A[] a, B[] b, Throwables.BiConsumer<? super A,? super B,E> action)
    Executes the provided action for each pair of elements from the given arrays until all elements from the shorter array are processed.
    static <T, E extends Exception>
    void
    forEach(Iterable<? extends T> c, Throwables.Consumer<? super T,E> action)
    Executes the provided action for each element in the given iterable.
    static <T, E extends Exception>
    void
    forEach(Iterable<? extends T> c, Throwables.Consumer<? super T,E> elementConsumer, int processThreadNum)
    Executes the provided elementConsumer for each element in the given iterable by the specified number of threads.
    static <T, E extends Exception>
    void
    forEach(Iterable<? extends T> c, Throwables.Consumer<? super T,E> elementConsumer, int processThreadNum, Executor executor)
    Executes the provided elementConsumer for each element in the given iterable by the specified number of threads and executor.
    static <T, T2, T3, E extends Exception, E2 extends Exception, E3 extends Exception>
    void
    forEach(Iterable<? extends T> c, Throwables.Function<? super T,? extends Iterable<T2>,E> flatMapper, Throwables.Function<? super T2,? extends Iterable<T3>,E2> flatMapper2, Throwables.TriConsumer<? super T,? super T2,? super T3,E3> action)
    Executes the provided action for each element in the given iterable after applying the flatMapper and flatMapper2 functions.
    static <T, U, E extends Exception, E2 extends Exception>
    void
    forEach(Iterable<? extends T> c, Throwables.Function<? super T,? extends Iterable<U>,E> flatMapper, Throwables.BiConsumer<? super T,? super U,E2> action)
    Applies the provided flatMapper function to each element in the given iterable, and then executes the specified action to each resulting element.
    static <A, B, E extends Exception>
    void
    forEach(Iterable<A> a, Iterable<B> b, A valueForNoneA, B valueForNoneB, Throwables.BiConsumer<? super A,? super B,E> action)
    Executes the provided action for each pair of elements from the given iterables until all elements from the longer iterable are processed.
    static <A, B, E extends Exception>
    void
    forEach(Iterable<A> a, Iterable<B> b, Throwables.BiConsumer<? super A,? super B,E> action)
    Executes the provided action for each pair of elements from the given iterables until all elements from the shorter iterable are processed.
    static <A, B, C, E extends Exception>
    void
    forEach(Iterable<A> a, Iterable<B> b, Iterable<C> c, A valueForNoneA, B valueForNoneB, C valueForNoneC, Throwables.TriConsumer<? super A,? super B,? super C,E> action)
    Executes the provided action for each triple of elements from the given iterables until all elements from the longest iterable are processed.
    static <A, B, C, E extends Exception>
    void
    forEach(Iterable<A> a, Iterable<B> b, Iterable<C> c, Throwables.TriConsumer<? super A,? super B,? super C,E> action)
    Executes the provided action for each triple of elements from the given iterables until all elements from the shortest iterable are processed.
    static <T, E extends Exception>
    void
    forEach(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.Consumer<? super T,E> action)
    Executes the provided action for each element within the specified range in the given collection.
    static <T, E extends Exception>
    void
    forEach(Iterator<? extends T> iter, Throwables.Consumer<? super T,E> action)
    Executes the provided action for each element in the given iterator.
    static <T, E extends Exception>
    void
    forEach(Iterator<? extends T> iter, Throwables.Consumer<? super T,E> elementConsumer, int processThreadNum)
    Executes the provided elementConsumer for each element in the given iterator by the specified number of threads.
    static <T, E extends Exception>
    void
    forEach(Iterator<? extends T> iter, Throwables.Consumer<? super T,E> elementConsumer, int processThreadNum, Executor executor)
    Executes the provided elementConsumer for each element in the given iterator by the specified number of threads and executor.
    static <T, T2, T3, E extends Exception, E2 extends Exception, E3 extends Exception>
    void
    forEach(Iterator<? extends T> iter, Throwables.Function<? super T,? extends Iterable<T2>,E> flatMapper, Throwables.Function<? super T2,? extends Iterable<T3>,E2> flatMapper2, Throwables.TriConsumer<? super T,? super T2,? super T3,E3> action)
    Executes the provided action for each element in the given iterator after applying the flatMapper and flatMapper2 functions.
    static <T, U, E extends Exception, E2 extends Exception>
    void
    forEach(Iterator<? extends T> iter, Throwables.Function<? super T,? extends Iterable<U>,E> flatMapper, Throwables.BiConsumer<? super T,? super U,E2> action)
    Applies the provided flatMapper function to each element in the given iterator, and then executes the specified action to each resulting element.
    static <A, B, E extends Exception>
    void
    forEach(Iterator<A> a, Iterator<B> b, A valueForNoneA, B valueForNoneB, Throwables.BiConsumer<? super A,? super B,E> action)
    Executes the provided action for each pair of elements from the given iterators until all elements from the longer iterator are processed.
    static <A, B, E extends Exception>
    void
    forEach(Iterator<A> a, Iterator<B> b, Throwables.BiConsumer<? super A,? super B,E> action)
    Executes the provided action for each pair of elements from the given iterators until all elements from the shorter iterator are processed.
    static <A, B, C, E extends Exception>
    void
    forEach(Iterator<A> a, Iterator<B> b, Iterator<C> c, A valueForNoneA, B valueForNoneB, C valueForNoneC, Throwables.TriConsumer<? super A,? super B,? super C,E> action)
    Executes the provided action for each triple of elements from the given iterators until all elements from the longest iterator are processed.
    static <A, B, C, E extends Exception>
    void
    forEach(Iterator<A> a, Iterator<B> b, Iterator<C> c, Throwables.TriConsumer<? super A,? super B,? super C,E> action)
    Executes the provided action for each triple of elements from the given iterators until all elements from the shortest iterator are processed.
    static <K, V, E extends Exception>
    void
    forEach(Map<K,V> map, Throwables.BiConsumer<? super K,? super V,E> action)
    Executes the provided action for each entry in the given map.
    static <K, V, E extends Exception>
    void
    forEach(Map<K,V> map, Throwables.Consumer<? super Map.Entry<K,V>,E> action)
    Executes the provided action for each entry in the given map.
    static <T, E extends Exception>
    void
    forEach(T[] a, int fromIndex, int toIndex, Throwables.Consumer<? super T,E> action)
    Executes the provided action for each element within the specified range in the given array.
    static <T, E extends Exception>
    void
    forEach(T[] a, Throwables.Consumer<? super T,E> action)
    Executes the provided action for each element in the given array.
    static <T, T2, T3, E extends Exception, E2 extends Exception, E3 extends Exception>
    void
    forEach(T[] a, Throwables.Function<? super T,? extends Iterable<T2>,E> flatMapper, Throwables.Function<? super T2,? extends Iterable<T3>,E2> flatMapper2, Throwables.TriConsumer<? super T,? super T2,? super T3,E3> action)
    Executes the provided action for each element in the given array after applying the flatMapper and flatMapper2 functions.
    static <T, U, E extends Exception, E2 extends Exception>
    void
    forEach(T[] a, Throwables.Function<? super T,? extends Iterable<U>,E> flatMapper, Throwables.BiConsumer<? super T,? super U,E2> action)
    Applies the provided flatMapper function to each element in the given array, and then executes the specified action to each resulting element.
    static <T, E extends Exception>
    void
    forEachIndexed(Iterable<? extends T> c, Throwables.IntObjConsumer<? super T,E> action)
    Executes the provided action for each element in the given iterable, passing the index and the element to the action.
    static <T, E extends Exception>
    void
    forEachIndexed(Iterable<? extends T> c, Throwables.IntObjConsumer<? super T,E> action, int processThreadNum)
    Executes the provided action for each element in the given Iterable, passing the index and the element to the action, by the specified number of threads.
    static <T, E extends Exception>
    void
    forEachIndexed(Iterable<? extends T> c, Throwables.IntObjConsumer<? super T,E> action, int processThreadNum, Executor executor)
    Executes the provided action for each element in the given Iterable, passing the index and the element to the action, by the specified number of threads and executor.
    static <T, E extends Exception>
    void
    forEachIndexed(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.IntObjConsumer<? super T,E> action)
    Executes the provided action for each element within the specified range in the given collection, passing the index and the element to the action.
    static <T, E extends Exception>
    void
    forEachIndexed(Iterator<? extends T> iter, Throwables.IntObjConsumer<? super T,E> action)
    Executes the provided action for each element in the given iterable, passing the index and the element to the action.
    static <T, E extends Exception>
    void
    forEachIndexed(Iterator<? extends T> iter, Throwables.IntObjConsumer<? super T,E> elementConsumer, int processThreadNum)
    Executes the provided action for each element in the given Iterator, passing the index and the element to the action, by the specified number of threads.
    static <T, E extends Exception>
    void
    forEachIndexed(Iterator<? extends T> iter, Throwables.IntObjConsumer<? super T,E> elementConsumer, int processThreadNum, Executor executor)
    Executes the provided action for each element in the given Iterator, passing the index and the element to the action, by the specified number of threads and executor.
    static <K, V, E extends Exception>
    void
    forEachIndexed(Map<K,V> map, Throwables.IntBiObjConsumer<? super K,? super V,E> action)
    Executes the provided action for each entry in the given map, passing the index, the key, and the value to the action.
    static <K, V, E extends Exception>
    void
    forEachIndexed(Map<K,V> map, Throwables.IntObjConsumer<? super Map.Entry<K,V>,E> action)
    Executes the provided action for each entry in the given map, passing the index and the entry to the action.
    static <T, E extends Exception>
    void
    forEachIndexed(T[] a, int fromIndex, int toIndex, Throwables.IntObjConsumer<? super T,E> action)
    Executes the provided action for each element within the specified range in the given array, passing the index and the element to the action.
    static <T, E extends Exception>
    void
    forEachIndexed(T[] a, Throwables.IntObjConsumer<? super T,E> action)
    Executes the provided action for each element in the given array, passing the index and the element to the action.
    static <T, E extends Exception>
    void
    forEachNonNull(Iterable<? extends T> c, Throwables.Consumer<? super T,E> action)
    Executes the provided action for each non-null element in the given iterable.
    static <T, T2, T3, E extends Exception, E2 extends Exception, E3 extends Exception>
    void
    forEachNonNull(Iterable<? extends T> c, Throwables.Function<? super T,? extends Iterable<T2>,E> flatMapper, Throwables.Function<? super T2,? extends Iterable<T3>,E2> flatMapper2, Throwables.TriConsumer<? super T,? super T2,? super T3,E3> action)
    Executes the provided action for each non-null element in the given iterable after applying the flatMapper and flatMapper2 functions.
    static <T, U, E extends Exception, E2 extends Exception>
    void
    forEachNonNull(Iterable<? extends T> c, Throwables.Function<? super T,? extends Iterable<U>,E> flatMapper, Throwables.BiConsumer<? super T,? super U,E2> action)
    Applies the provided flatMapper function to each non-null element in the given iterable, and then executes the specified action to each non-null resulting element.
    static <T, E extends Exception>
    void
    forEachNonNull(Iterator<? extends T> iter, Throwables.Consumer<? super T,E> action)
    Executes the provided action for each non-null element in the given iterator.
    static <T, T2, T3, E extends Exception, E2 extends Exception, E3 extends Exception>
    void
    forEachNonNull(Iterator<? extends T> iter, Throwables.Function<? super T,? extends Iterable<T2>,E> flatMapper, Throwables.Function<? super T2,? extends Iterable<T3>,E2> flatMapper2, Throwables.TriConsumer<? super T,? super T2,? super T3,E3> action)
    Executes the provided action for each non-null element in the given iterator after applying the flatMapper and flatMapper2 functions.
    static <T, U, E extends Exception, E2 extends Exception>
    void
    forEachNonNull(Iterator<? extends T> iter, Throwables.Function<? super T,? extends Iterable<U>,E> flatMapper, Throwables.BiConsumer<? super T,? super U,E2> action)
    Applies the provided flatMapper function to each non-null element in the given iterator, and then executes the specified action to each non-null resulting element.
    static <T, E extends Exception>
    void
    forEachNonNull(T[] a, Throwables.Consumer<? super T,E> action)
    Executes the provided action for each non-null element in the given array.
    static <T, T2, T3, E extends Exception, E2 extends Exception, E3 extends Exception>
    void
    forEachNonNull(T[] a, Throwables.Function<? super T,? extends Iterable<T2>,E> flatMapper, Throwables.Function<? super T2,? extends Iterable<T3>,E2> flatMapper2, Throwables.TriConsumer<? super T,? super T2,? super T3,E3> action)
    Executes the provided action for each non-null element in the given array after applying the flatMapper and flatMapper2 functions.
    static <T, U, E extends Exception, E2 extends Exception>
    void
    forEachNonNull(T[] a, Throwables.Function<? super T,? extends Iterable<U>,E> flatMapper, Throwables.BiConsumer<? super T,? super U,E2> action)
    Applies the provided flatMapper function to each non-null element in the given array, and then executes the specified action to each non-null resulting element.
    static <T, E extends Exception>
    void
    forEachPair(Iterable<? extends T> c, int increment, Throwables.BiConsumer<? super T,? super T,E> action)
    Executes the provided action for each pair of consecutive elements in the given iterable, with the specified increment between pairs.
    static <T, E extends Exception>
    void
    forEachPair(Iterable<? extends T> c, Throwables.BiConsumer<? super T,? super T,E> action)
    Executes the provided action for each pair of consecutive elements in the given iterable.
    static <T, E extends Exception>
    void
    forEachPair(Iterator<? extends T> iter, int increment, Throwables.BiConsumer<? super T,? super T,E> action)
    Executes the provided action for each pair of consecutive elements in the given iterator, with the specified increment between pairs.
    static <T, E extends Exception>
    void
    forEachPair(Iterator<? extends T> iter, Throwables.BiConsumer<? super T,? super T,E> action)
    Executes the provided action for each pair of consecutive elements in the given iterator.
    static <T, E extends Exception>
    void
    forEachPair(T[] a, int increment, Throwables.BiConsumer<? super T,? super T,E> action)
    Executes the provided action for each pair of consecutive elements in the given array, with the specified increment between pairs.
    static <T, E extends Exception>
    void
    forEachPair(T[] a, Throwables.BiConsumer<? super T,? super T,E> action)
    Executes the provided action for each pair of consecutive elements in the given array.
    static <T, E extends Exception>
    void
    forEachTriple(Iterable<? extends T> c, int increment, Throwables.TriConsumer<? super T,? super T,? super T,E> action)
    Executes the provided action for each triple of consecutive elements in the given iterable, with the specified increment between triples.
    static <T, E extends Exception>
    void
    forEachTriple(Iterable<? extends T> c, Throwables.TriConsumer<? super T,? super T,? super T,E> action)
    Executes the provided action for each triple of consecutive elements in the given iterable.
    static <T, E extends Exception>
    void
    forEachTriple(Iterator<? extends T> iter, int increment, Throwables.TriConsumer<? super T,? super T,? super T,E> action)
    Executes the provided action for each triple of consecutive elements in the given iterator, with the specified increment between triples.
    static <T, E extends Exception>
    void
    forEachTriple(Iterator<? extends T> iter, Throwables.TriConsumer<? super T,? super T,? super T,E> action)
    Executes the provided action for each triple of consecutive elements in the given iterator.
    static <T, E extends Exception>
    void
    forEachTriple(T[] a, int increment, Throwables.TriConsumer<? super T,? super T,? super T,E> action)
    Executes the provided action for each triple of consecutive elements in the given array, with the specified increment between triples.
    static <T, E extends Exception>
    void
    forEachTriple(T[] a, Throwables.TriConsumer<? super T,? super T,? super T,E> action)
    Executes the provided action for each triple of consecutive elements in the given array.
    static String
    Formats the given JSON string to its pretty-printed JSON format with indents and line breaks for easier reading.
    static String
    Formats the given JSON string to its pretty-printed JSON format with indents and line breaks for easier reading.
    static String
    formatJson(String json, JSONSerializationConfig config, com.landawn.abacus.type.Type<?> transferType)
    Formats the given JSON string to its pretty-printed JSON format with indents and line breaks for easier reading.
    static String
    formatJson(String json, JSONSerializationConfig config, Class<?> transferType)
    Formats the given JSON string to its pretty-printed JSON format with indents and line breaks for easier reading.
    static String
    formatJson(String json, com.landawn.abacus.type.Type<?> transferType)
    Formats the given JSON string to its pretty-printed JSON format with indents and line breaks for easier reading.
    static String
    formatJson(String json, Class<?> transferType)
    Formats the given JSON string to its pretty-printed JSON format with indents and line breaks for easier reading.
    static String
    Formats the given XML string to its pretty-printed XML format with indents and line breaks for easier reading.
    static String
    Formats the given XML string to its pretty-printed XML format with indents and line breaks for easier reading with the specified XMLSerializationConfig.
    static String
    formatXml(String xml, XMLSerializationConfig config, com.landawn.abacus.type.Type<?> transferType)
    Formats the given XML string to its pretty-printed XML format with indents and line breaks for easier reading with the specified XMLSerializationConfig
    static String
    formatXml(String xml, XMLSerializationConfig config, Class<?> transferType)
    Formats the given XML string to its pretty-printed XML format with indents and line breaks for easier reading with the specified XMLSerializationConfig
    static String
    formatXml(String xml, com.landawn.abacus.type.Type<?> transferType)
    Formats the given XML string to its pretty-printed XML format with indents and line breaks for easier reading.
    static String
    formatXml(String xml, Class<?> transferType)
    Formats the given XML string to its pretty-printed XML format with indents and line breaks for easier reading.
    static void
    fprintln(String format, Object... args)
    Prints the formatted string to the standard output using the specified format and arguments.
    static <T> T
    fromJson(File json, JSONDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> targetType)
    Deserializes the given JSON string from the specified file into an object of the specified target type with the specified JSONDeserializationConfig.
    static <T> T
    fromJson(File json, JSONDeserializationConfig config, Class<? extends T> targetType)
    Deserializes the given JSON string from the specified file into an object of the specified target type with the specified JSONDeserializationConfig.
    static <T> T
    fromJson(File json, com.landawn.abacus.type.Type<? extends T> targetType)
    Deserializes the given JSON string from the specified file into an object of the specified target type.
    static <T> T
    fromJson(File json, Class<? extends T> targetType)
    Deserializes the given JSON string from the specified file into an object of the specified target type.
    static <T> T
    fromJson(InputStream json, JSONDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> targetType)
    Deserializes the given JSON string from the specified input stream into an object of the specified target type with the specified JSONDeserializationConfig.
    static <T> T
    fromJson(InputStream json, JSONDeserializationConfig config, Class<? extends T> targetType)
    Deserializes the given JSON string from the specified input stream into an object of the specified target type with the specified JSONDeserializationConfig.
    static <T> T
    fromJson(InputStream json, com.landawn.abacus.type.Type<? extends T> targetType)
    Deserializes the given JSON string from the specified input stream into an object of the specified target type.
    static <T> T
    fromJson(InputStream json, Class<? extends T> targetType)
    Deserializes the given JSON string from the specified input stream into an object of the specified target type.
    static <T> T
    fromJson(Reader json, JSONDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> targetType)
    Deserializes the given JSON string from the specified reader into an object of the specified target type with the specified JSONDeserializationConfig.
    static <T> T
    fromJson(Reader json, JSONDeserializationConfig config, Class<? extends T> targetType)
    Deserializes the given JSON string from the specified reader into an object of the specified target type with the specified JSONDeserializationConfig.
    static <T> T
    fromJson(Reader json, com.landawn.abacus.type.Type<? extends T> targetType)
    Deserializes the given JSON string from the specified reader into an object of the specified target type.
    static <T> T
    fromJson(Reader json, Class<? extends T> targetType)
    Deserializes the given JSON string from the specified reader into an object of the specified target type.
    static <T> T
    fromJson(String json, int fromIndex, int toIndex, JSONDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> targetType)
    Deserializes the given JSON sub-string in the specified range into an object of the specified target type with the specified JSONDeserializationConfig.
    static <T> T
    fromJson(String json, int fromIndex, int toIndex, JSONDeserializationConfig config, Class<? extends T> targetType)
    Deserializes the given JSON sub-string in the specified range into an object of the specified target type with the specified JSONDeserializationConfig.
    static <T> T
    fromJson(String json, int fromIndex, int toIndex, com.landawn.abacus.type.Type<? extends T> targetType)
    Deserializes the given JSON sub-string in the specified range into an object of the specified target type.
    static <T> T
    fromJson(String json, int fromIndex, int toIndex, Class<? extends T> targetType)
    Deserializes the given JSON sub-string in the specified range into an object of the specified target type.
    static <T> T
    fromJson(String json, JSONDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> targetType)
    Deserializes the given JSON string into an object of the specified target type with the specified JSONDeserializationConfig.
    static <T> T
    fromJson(String json, JSONDeserializationConfig config, Class<? extends T> targetType)
    Deserializes the given JSON string into an object of the specified target type with the specified JSONDeserializationConfig.
    static <T> T
    fromJson(String json, com.landawn.abacus.type.Type<? extends T> targetType)
    Deserializes the given JSON string into an object of the specified target type.
    static <T> T
    fromJson(String json, Class<? extends T> targetType)
    Deserializes the given JSON string into an object of the specified target type.
    static <T> T
    fromJson(String json, T defaultIfNull, com.landawn.abacus.type.Type<? extends T> targetType)
    Deserializes the given JSON string into an object of the specified target type.
    static <T> T
    fromJson(String json, T defaultIfNull, Class<? extends T> targetType)
    Deserializes the given JSON string into an object of the specified target type.
    static <T> T
    fromXml(File xml, XMLDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> targetType)
    Deserializes the given XML string from the specified file into an object of the specified target type with the specified XMLDeserializationConfig.
    static <T> T
    fromXml(File xml, XMLDeserializationConfig config, Class<? extends T> targetType)
    Deserializes the given XML string from the specified file into an object of the specified target type with the specified XMLDeserializationConfig.
    static <T> T
    fromXml(File xml, com.landawn.abacus.type.Type<? extends T> targetType)
    Deserializes the given XML string from the specified file into an object of the specified target type.
    static <T> T
    fromXml(File xml, Class<? extends T> targetType)
    Deserializes the given XML string from the specified file into an object of the specified target type.
    static <T> T
    fromXml(InputStream xml, XMLDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> targetType)
    Deserializes the given XML string from the specified input stream into an object of the specified target type with the specified XMLDeserializationConfig.
    static <T> T
    fromXml(InputStream xml, XMLDeserializationConfig config, Class<? extends T> targetType)
    Deserializes the given XML string from the specified input stream into an object of the specified target type with the specified XMLDeserializationConfig.
    static <T> T
    fromXml(InputStream xml, com.landawn.abacus.type.Type<? extends T> targetType)
    Deserializes the given XML string from the specified input stream into an object of the specified target type.
    static <T> T
    fromXml(InputStream xml, Class<? extends T> targetType)
    Deserializes the given XML string from the specified input stream into an object of the specified target type.
    static <T> T
    fromXml(Reader xml, XMLDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> targetType)
    Deserializes the given XML string from the specified reader into an object of the specified target type with the specified XMLDeserializationConfig.
    static <T> T
    fromXml(Reader xml, XMLDeserializationConfig config, Class<? extends T> targetType)
    Deserializes the given XML string from the specified reader into an object of the specified target type with the specified XMLDeserializationConfig.
    static <T> T
    fromXml(Reader xml, com.landawn.abacus.type.Type<? extends T> targetType)
    Deserializes the given XML string from the specified reader into an object of the specified target type.
    static <T> T
    fromXml(Reader xml, Class<? extends T> targetType)
    Deserializes the given XML string from the specified reader into an object of the specified target type.
    static <T> T
    fromXml(String xml, XMLDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> targetType)
    Deserializes the given XML string into an object of the specified target type with the specified XMLDeserializationConfig.
    static <T> T
    fromXml(String xml, XMLDeserializationConfig config, Class<? extends T> targetType)
    Deserializes the given XML string into an object of the specified target type with the specified XMLDeserializationConfig.
    static <T> T
    fromXml(String xml, com.landawn.abacus.type.Type<? extends T> targetType)
    Deserializes the given XML string into an object of the specified target type.
    static <T> T
    fromXml(String xml, Class<? extends T> targetType)
    Deserializes the given XML string into an object of the specified target type.
    static <T extends Comparable<? super T>>
    boolean
    geAndLe(T value, T min, T max)
    Checks if the given value is greater than or equal to the minimum value and less than or equal to the maximum value.
    static <T> boolean
    geAndLe(T value, T min, T max, Comparator<? super T> cmp)
    Checks if the given value is greater than or equal to the minimum value and less than or equal to the maximum value using the specified comparator.
    static <T extends Comparable<? super T>>
    boolean
    geAndLt(T value, T min, T max)
    Checks if the given value is greater than or equal to the minimum value and less than the maximum value.
    static <T> boolean
    geAndLt(T value, T min, T max, Comparator<? super T> cmp)
    Checks if the given value is greater than or equal to the minimum value and less than the maximum value using the specified comparator.
    static <T> T
    getElement(Iterable<? extends T> c, int index)
    Retrieves the element at the specified position in the given Iterable.
    static <T> T
    getElement(Iterator<? extends T> iter, long index)
    Retrieves the element at the specified position in the given Iterator.
    static <T> u.Nullable<T>
    getOnlyElement(Iterable<? extends T> c)
    Returns the only element in the given Iterable.
    static <T> u.Nullable<T>
    getOnlyElement(Iterator<? extends T> iter)
    Returns the only element in the given Iterator.
    getPropNames(Class<?> beanClass)
    Retrieves the property names of the given bean class.
    static List<String>
    getPropNames(Class<?> beanClass, Set<String> propNameToExclude)
    Retrieves the property names of the given bean class excluding the specified property names.
    static List<String>
    Retrieves the property names of the given bean object.
    static List<String>
    getPropNames(Object bean, boolean ignoreNullValue)
    Retrieves the property names of the given bean object.
    static <T> T
    getPropValue(Object bean, String propName)
    Retrieves the value of the specified property from the given bean object.
    static <T> T
    getPropValue(Object bean, String propName, boolean ignoreUnmatchedProperty)
    Retrieves the value of the specified property from the given bean object.
    static <T extends Comparable<? super T>>
    boolean
    greaterEqual(T a, T b)
    Compares two comparable objects to determine if the first is greater than or equal to the second.
    static <T> boolean
    greaterEqual(T a, T b, Comparator<? super T> cmp)
    Compares two objects using the specified comparator to determine if the first is greater than or equal to the second.
    static <T extends Comparable<? super T>>
    boolean
    greaterThan(T a, T b)
    Compares two comparable objects to determine if the first is greater than the second.
    static <T> boolean
    greaterThan(T a, T b, Comparator<? super T> cmp)
    Compares two objects using the specified comparator to determine if the first is greater than the second.
    static <T, K> Map<K,List<T>>
    groupBy(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor)
    Groups the elements in the given iterable by the key extracted by the specified Function<T, K>.
    static <T, K, V> Map<K,List<V>>
    groupBy(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor, Function<? super T,? extends V> valueExtractor)
    Groups the elements in the given iterable by the key extracted by the specified Function<T, K>.
    static <T, K, V, M extends Map<K, List<V>>>
    M
    groupBy(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor, Function<? super T,? extends V> valueExtractor, Supplier<M> mapSupplier)
    Groups the elements in the given iterable by the key extracted by the specified Function<T, K>.
    static <T, K, M extends Map<K, List<T>>>
    M
    groupBy(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor, Supplier<M> mapSupplier)
    Groups the elements in the given iterable by the key extracted by the specified Function<T, K>.
    static <T, K, R> Map<K,R>
    groupBy(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor, Collector<? super T,?,R> collector)
    Groups the elements in the given array by the key extracted by the specified Function<T, K>.
    static <T, K, R, M extends Map<K, R>>
    M
    groupBy(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor, Collector<? super T,?,R> collector, Supplier<M> mapSupplier)
    Groups the elements in the given array by the key extracted by the specified Function<T, K>.
    static <T, K> Map<K,List<T>>
    groupBy(Collection<? extends T> c, int fromIndex, int toIndex, Function<? super T,? extends K> keyExtractor)
    Groups the elements within specified range in the given collection by the key extracted by the specified Function<T, K>.
    static <T, K, M extends Map<K, List<T>>>
    M
    groupBy(Collection<? extends T> c, int fromIndex, int toIndex, Function<? super T,? extends K> keyExtractor, Supplier<M> mapSupplier)
    Groups the elements within specified range in the given collection by the key extracted by the specified Function<T, K>.
    static <T, K> Map<K,List<T>>
    groupBy(Iterator<? extends T> iter, Function<? super T,? extends K> keyExtractor)
    Groups the elements in the given iterator by the key extracted by the specified Function<T, K>.
    static <T, K, V> Map<K,List<V>>
    groupBy(Iterator<? extends T> iter, Function<? super T,? extends K> keyExtractor, Function<? super T,? extends V> valueExtractor)
    Groups the elements in the given iterator by the key extracted by the specified Function<T, K>.
    static <T, K, V, M extends Map<K, List<V>>>
    M
    groupBy(Iterator<? extends T> iter, Function<? super T,? extends K> keyExtractor, Function<? super T,? extends V> valueExtractor, Supplier<M> mapSupplier)
    Groups the elements in the given iterator by the key extracted by the specified Function<T, K>.
    static <T, K, M extends Map<K, List<T>>>
    M
    groupBy(Iterator<? extends T> iter, Function<? super T,? extends K> keyExtractor, Supplier<M> mapSupplier)
    Groups the elements in the given iterator by the key extracted by the specified Function<T, K>.
    static <K, T, R> Map<K,R>
    groupBy(Iterator<? extends T> iter, Function<? super T,? extends K> keyExtractor, Collector<? super T,?,R> collector)
    Groups the elements in the given iterator by the key extracted by the specified Function<T, K>.
    static <K, T, R, M extends Map<K, R>>
    M
    groupBy(Iterator<? extends T> iter, Function<? super T,? extends K> keyExtractor, Collector<? super T,?,R> collector, Supplier<M> mapSupplier)
    Groups the elements in the given iterator by the key extracted by the specified Function<T, K>.
    static <T, K> Map<K,List<T>>
    groupBy(T[] a, int fromIndex, int toIndex, Function<? super T,? extends K> keyExtractor)
    Groups the elements within specified range in the given array by the key extracted by the specified Function<T, K>.
    static <T, K, M extends Map<K, List<T>>>
    M
    groupBy(T[] a, int fromIndex, int toIndex, Function<? super T,? extends K> keyExtractor, Supplier<M> mapSupplier)
    Groups the elements within specified range in the given array by the key extracted by the specified Function<T, K>.
    static <T, K> Map<K,List<T>>
    groupBy(T[] a, Function<? super T,? extends K> keyExtractor)
    Groups the elements in the given array by the key extracted by the specified Function<T, K>.
    static <T, K, M extends Map<K, List<T>>>
    M
    groupBy(T[] a, Function<? super T,? extends K> keyExtractor, Supplier<M> mapSupplier)
    Groups the elements in the given array by the key extracted by the specified Function<T, K>.
    static <T extends Comparable<? super T>>
    boolean
    gtAndLe(T value, T min, T max)
    Checks if the given value is greater than the minimum value and less than or equal to the maximum value.
    static <T> boolean
    gtAndLe(T value, T min, T max, Comparator<? super T> cmp)
    Checks if the given value is greater than the minimum value and less than or equal to the maximum value using the specified comparator.
    static <T extends Comparable<? super T>>
    boolean
    gtAndLt(T value, T min, T max)
    Checks if the given value is greater than the minimum value and less than the maximum value.
    static <T> boolean
    gtAndLt(T value, T min, T max, Comparator<? super T> cmp)
    Checks if the given value is greater than the minimum value and less than the maximum value using the specified comparator.
    static boolean
    hasDuplicates(boolean[] a)
    Checks if the given array has duplicate elements.
    static boolean
    hasDuplicates(byte[] a)
    Checks if the given array has duplicate elements.
    static boolean
    hasDuplicates(byte[] a, boolean isSorted)
    Checks if the given array has duplicate elements.
    static boolean
    hasDuplicates(char[] a)
    Checks if the given array has duplicate elements.
    static boolean
    hasDuplicates(char[] a, boolean isSorted)
    Checks if the given array has duplicate elements.
    static boolean
    hasDuplicates(double[] a)
    Checks if the given array has duplicate elements.
    static boolean
    hasDuplicates(double[] a, boolean isSorted)
    Checks if the given array has duplicate elements.
    static boolean
    hasDuplicates(float[] a)
    Checks if the given array has duplicate elements.
    static boolean
    hasDuplicates(float[] a, boolean isSorted)
    Checks if the given array has duplicate elements.
    static boolean
    hasDuplicates(int[] a)
    Checks if the given array has duplicate elements.
    static boolean
    hasDuplicates(int[] a, boolean isSorted)
    Checks if the given array has duplicate elements.
    static boolean
    hasDuplicates(long[] a)
    Checks if the given array has duplicate elements.
    static boolean
    hasDuplicates(long[] a, boolean isSorted)
    Checks if the given array has duplicate elements.
    static boolean
    hasDuplicates(short[] a)
    Checks if the given array has duplicate elements.
    static boolean
    hasDuplicates(short[] a, boolean isSorted)
    Checks if the given array has duplicate elements.
    static boolean
    Checks if the given collection has duplicate elements.
    static boolean
    hasDuplicates(Collection<?> c, boolean isSorted)
    Checks if the given collection has duplicate elements.
    static <T> boolean
    Checks if the given array has duplicate elements.
    static <T> boolean
    hasDuplicates(T[] a, boolean isSorted)
    Checks if the given array has duplicate elements.
    static int
    hashCode(boolean value)
    Returns the hash code for a boolean value.
    static int
    hashCode(boolean[] a)
    Returns the hash code for an array of booleans.
    static int
    hashCode(boolean[] a, int fromIndex, int toIndex)
    Returns the hash code for a range of elements in a boolean array.
    static int
    hashCode(byte value)
    Returns the hash code for a byte value.
    static int
    hashCode(byte[] a)
    Returns the hash code for an array of bytes.
    static int
    hashCode(byte[] a, int fromIndex, int toIndex)
    Returns the hash code for a range of elements in a byte array.
    static int
    hashCode(char value)
    Returns the hash code for a char value.
    static int
    hashCode(char[] a)
    Returns the hash code for an array of chars.
    static int
    hashCode(char[] a, int fromIndex, int toIndex)
    Returns the hash code for a range of elements in a char array.
    static int
    hashCode(double value)
    Returns the hash code for a double value.
    static int
    hashCode(double[] a)
    Returns the hash code for an array of doubles.
    static int
    hashCode(double[] a, int fromIndex, int toIndex)
    Returns the hash code for a range of elements in a double array.
    static int
    hashCode(float value)
    Returns the hash code for a float value.
    static int
    hashCode(float[] a)
    Returns the hash code for an array of floats.
    static int
    hashCode(float[] a, int fromIndex, int toIndex)
    Returns the hash code for a range of elements in a float array.
    static int
    hashCode(int value)
    Returns the hash code for an int value.
    static int
    hashCode(int[] a)
    Returns the hash code for an array of ints.
    static int
    hashCode(int[] a, int fromIndex, int toIndex)
    Returns the hash code for a range of elements in an int array.
    static int
    hashCode(long value)
    Returns the hash code for a long value.
    static int
    hashCode(long[] a)
    Returns the hash code for an array of longs.
    static int
    hashCode(long[] a, int fromIndex, int toIndex)
    Returns the hash code for a range of elements in a long array.
    static int
    hashCode(short value)
    Returns the hash code for a short value.
    static int
    hashCode(short[] a)
    Returns the hash code for an array of shorts.
    static int
    hashCode(short[] a, int fromIndex, int toIndex)
    Returns the hash code for a range of elements in a short array.
    static int
    Returns the hash code for an object.
    static int
    Returns the hash code for an array of Objects.
    static int
    hashCode(Object[] a, int fromIndex, int toIndex)
    Returns the hash code for a range of elements in an Object array.
    static <C extends Collection, E extends Exception>
    void
    ifNotEmpty(C c, Throwables.Consumer<? super C,E> cmd)
    Executes the provided action if the given collection is not empty.
    static <CS extends CharSequence, E extends Exception>
    void
    ifNotEmpty(CS c, Throwables.Consumer<? super CS,E> cmd)
    Executes the provided action if the given CharSequence is not empty.
    static <M extends Map, E extends Exception>
    void
    ifNotEmpty(M m, Throwables.Consumer<? super M,E> cmd)
    Executes the provided action if the given map is not empty.
    static <T, E extends Exception>
    void
    ifNotNull(T obj, Throwables.Consumer<? super T,E> cmd)
    Executes the given Consumer if the provided object is not null.
    static <E1 extends Exception, E2 extends Exception>
    void
    ifOrElse(boolean b, Throwables.Runnable<E1> actionForTrue, Throwables.Runnable<E2> actionForFalse)
    Deprecated.
    it's not a good idea? if-else is better?
    static <R, E extends Exception>
    u.Nullable<R>
    ifOrEmpty(boolean b, Throwables.Supplier<R,E> supplier)
    Returns a Nullable containing the result of the given supplier if the condition is true.
    static int
    indexOf(boolean[] a, boolean valueToFind)
    Returns the index of the first occurrence of the specified value in the array.
    static int
    indexOf(boolean[] a, boolean valueToFind, int fromIndex)
    Returns the index of the first occurrence of the specified value in the array, starting the search at the specified index.
    static int
    indexOf(byte[] a, byte valueToFind)
    Returns the index of the first occurrence of the specified value in the array.
    static int
    indexOf(byte[] a, byte valueToFind, int fromIndex)
    Returns the index of the first occurrence of the specified value in the array, starting the search at the specified index.
    static int
    indexOf(char[] a, char valueToFind)
    Returns the index of the first occurrence of the specified value in the array.
    static int
    indexOf(char[] a, char valueToFind, int fromIndex)
    Returns the index of the first occurrence of the specified value in the array, starting the search at the specified index.
    static int
    indexOf(double[] a, double valueToFind)
    Returns the index of the first occurrence of the specified value in the array.
    static int
    indexOf(double[] a, double valueToFind, double tolerance)
    Finds the index of the given value within a given tolerance in the array.
    static int
    indexOf(double[] a, double valueToFind, double tolerance, int fromIndex)
    Finds the index of the given value in the array starting at the given index.
    static int
    indexOf(double[] a, double valueToFind, int fromIndex)
    Returns the index of the first occurrence of the specified value in the array, starting the search at the specified index.
    static int
    indexOf(float[] a, float valueToFind)
    Returns the index of the first occurrence of the specified value in the array.
    static int
    indexOf(float[] a, float valueToFind, int fromIndex)
    Returns the index of the first occurrence of the specified value in the array, starting the search at the specified index.
    static int
    indexOf(int[] a, int valueToFind)
    Returns the index of the first occurrence of the specified value in the array.
    static int
    indexOf(int[] a, int valueToFind, int fromIndex)
    Returns the index of the first occurrence of the specified value in the array, starting the search at the specified index.
    static int
    indexOf(long[] a, long valueToFind)
    Returns the index of the first occurrence of the specified value in the array.
    static int
    indexOf(long[] a, long valueToFind, int fromIndex)
    Returns the index of the first occurrence of the specified value in the array, starting the search at the specified index.
    static int
    indexOf(short[] a, short valueToFind)
    Returns the index of the first occurrence of the specified value in the array.
    static int
    indexOf(short[] a, short valueToFind, int fromIndex)
    Returns the index of the first occurrence of the specified value in the array, starting the search at the specified index.
    static int
    indexOf(Object[] a, Object valueToFind)
    Returns the index of the first occurrence of the specified value in the array.
    static int
    indexOf(Object[] a, Object valueToFind, int fromIndex)
    Returns the index of the first occurrence of the specified value in the array, starting the search at the specified index.
    static int
    indexOf(Collection<?> c, Object valueToFind)
    Returns the index of the first occurrence of the specified value in the specified collection.
    static int
    indexOf(Collection<?> c, Object valueToFind, int fromIndex)
    Returns the index of the first occurrence of the specified value in the specified collection, starting the search at the specified index.
    static int
    indexOf(Iterator<?> iter, Object valueToFind)
    Returns the index of the first occurrence of the specified value in the given iterator.
    static int
    indexOf(Iterator<?> iter, Object valueToFind, int fromIndex)
    Returns the index of the first occurrence of the specified value in the given iterator, starting the search from the specified index.
    static int
    indexOfIgnoreCase(String[] a, String valueToFind)
    Returns the index of the first occurrence of the specified string in the array, ignoring case considerations.
    static int
    indexOfIgnoreCase(String[] a, String valueToFind, int fromIndex)
    Returns the index of the first occurrence of the specified string in the array, ignoring case considerations, starting the search at the specified index.
    static int
    indexOfSubList(List<?> sourceList, List<?> subListToFind)
    Returns the starting position of the first occurrence of the specified sublist within the source list.
    static int
    indexOfSubList(List<?> sourceList, List<?> subListToFind, int fromIndex)
    Returns the starting position of the first occurrence of the specified sublist within the source list, starting the search at the specified index.
    static int[]
    indicesOfAll(Object[] a, Object valueToFind)
    Returns the indices of all occurrences of the specified value in the given array.
    static int[]
    indicesOfAll(Object[] a, Object valueToFind, int startIndex)
    Returns the indices of all occurrences of the specified value in the given array, starting the search from the specified index.
    static int[]
    indicesOfAll(Collection<?> c, Object valueToFind)
    Returns the indices of all occurrences of the specified value in the specified collection.
    static int[]
    indicesOfAll(Collection<?> c, Object valueToFind, int startIndex)
    Returns the indices of all occurrences of the specified value in the specified collection, starting the search from the specified index.
    static <T> int[]
    indicesOfAll(Collection<? extends T> c, Predicate<? super T> predicate)
    Returns the indices of all elements in the specified collection that match the given predicate.
    static <T> int[]
    indicesOfAll(Collection<? extends T> c, Predicate<? super T> predicate, int fromIndex)
    Returns the indices of all elements in the specified collection that match the given predicate, starting the search from the specified index.
    static <T> int[]
    indicesOfAll(T[] a, Predicate<? super T> predicate)
    Returns the indices of all elements in the specified array that match the given predicate.
    static <T> int[]
    indicesOfAll(T[] a, Predicate<? super T> predicate, int startIndex)
    Returns the indices of all elements in the specified array that match the given predicate, starting the search from the specified index.
    static <T extends Comparable<? super T>>
    int[]
    indicesOfAllMax(Collection<? extends T> c)
    Returns the indices of all maximum elements in the specified collection.
    static <T> int[]
    indicesOfAllMax(Collection<? extends T> c, Comparator<? super T> cmp)
    Returns the indices of all maximum elements in the specified collection using the provided comparator.
    static <T extends Comparable<? super T>>
    int[]
    Returns the indices of all maximum elements in the specified array.
    static <T> int[]
    indicesOfAllMax(T[] a, Comparator<? super T> cmp)
    Returns the indices of all maximum elements in the specified array using the provided comparator.
    static <T extends Comparable<? super T>>
    int[]
    indicesOfAllMin(Collection<? extends T> c)
    Returns the indices of all minimum elements in the specified collection.
    static <T> int[]
    indicesOfAllMin(Collection<? extends T> c, Comparator<? super T> cmp)
    Returns the indices of all minimum elements in the specified collection using the provided comparator.
    static <T extends Comparable<? super T>>
    int[]
    Returns the indices of all minimum elements in the specified array.
    static <T> int[]
    indicesOfAllMin(T[] a, Comparator<? super T> cmp)
    Returns the indices of all minimum elements in the specified array using the provided comparator.
    static boolean[]
    insert(boolean[] a, int index, boolean elementToInsert)
    Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
    static byte[]
    insert(byte[] a, int index, byte elementToInsert)
    Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
    static char[]
    insert(char[] a, int index, char elementToInsert)
    Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
    static double[]
    insert(double[] a, int index, double elementToInsert)
    Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
    static float[]
    insert(float[] a, int index, float elementToInsert)
    Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
    static int[]
    insert(int[] a, int index, int elementToInsert)
    Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
    static long[]
    insert(long[] a, int index, long elementToInsert)
    Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
    static short[]
    insert(short[] a, int index, short elementToInsert)
    Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
    static String[]
    insert(String[] a, int index, String elementToInsert)
    Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
    static String
    insert(String str, int index, String strToInsert)
    Returns a new String with chars copied from the specified String and the specified String inserted at the specified index.
    static <T> T[]
    insert(T[] a, int index, T elementToInsert)
    Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
    static boolean[]
    insertAll(boolean[] a, int index, boolean... elementsToInsert)
    Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
    static byte[]
    insertAll(byte[] a, int index, byte... elementsToInsert)
    Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
    static char[]
    insertAll(char[] a, int index, char... elementsToInsert)
    Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
    static double[]
    insertAll(double[] a, int index, double... elementsToInsert)
    Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
    static float[]
    insertAll(float[] a, int index, float... elementsToInsert)
    Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
    static int[]
    insertAll(int[] a, int index, int... elementsToInsert)
    Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
    static long[]
    insertAll(long[] a, int index, long... elementsToInsert)
    Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
    static short[]
    insertAll(short[] a, int index, short... elementsToInsert)
    Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
    static String[]
    insertAll(String[] a, int index, String... elementsToInsert)
    Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
    static <T> boolean
    insertAll(List<T> list, int index, Collection<? extends T> elementsToInsert)
    Inserts the specified elements at the specified position in the list.
    static <T> boolean
    insertAll(List<T> list, int index, T... elementsToInsert)
    Inserts the specified elements at the specified position in the list.
    static <T> T[]
    insertAll(T[] a, int index, T... elementsToInsert)
    Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
    static boolean[]
    intersection(boolean[] a, boolean[] b)
    Returns the elements in the specified boolean arrays a and b that are present in both arrays.
    static byte[]
    intersection(byte[] a, byte[] b)
    Returns the elements in the specified byte arrays a and b that are present in both arrays.
    static char[]
    intersection(char[] a, char[] b)
    Returns the elements in the specified char arrays a and b that are present in both arrays.
    static double[]
    intersection(double[] a, double[] b)
    Returns the elements in the specified double arrays a and b that are present in both arrays.
    static float[]
    intersection(float[] a, float[] b)
    Returns the elements in the specified float arrays a and b that are present in both arrays.
    static int[]
    intersection(int[] a, int[] b)
    Returns the elements in the specified int arrays a and b that are present in both arrays.
    static long[]
    intersection(long[] a, long[] b)
    Returns the elements in the specified long arrays a and b that are present in both arrays.
    static short[]
    intersection(short[] a, short[] b)
    Returns the elements in the specified short arrays a and b that are present in both arrays.
    static <T> List<T>
    intersection(Collection<? extends Collection<? extends T>> c)
    Returns the elements that are present in all collections within the specified collection of collections.
    static <T> List<T>
    intersection(Collection<? extends T> a, Collection<?> b)
    Returns the elements in the specified collections a and b that are present in both collections.
    static <T> List<T>
    intersection(Collection<? extends T> a, Collection<?> b, boolean ignoreOcurrences)
    Return only the elements in the first collection that are contained in the specified second collection.
    static <T> List<T>
    intersection(T[] a, Object[] b)
    Returns the elements in the specified arrays a and b that are present in both arrays.
    static <T extends Comparable<? super T>>
    boolean
    isBetween(T value, T min, T max)
    Deprecated.
    replaced by gtAndLt(Comparable, Comparable, Comparable)
    static <T> boolean
    isBetween(T value, T min, T max, Comparator<? super T> cmp)
    Deprecated.
    replaced by gtAndLt(Comparable, Comparable, Comparable, Comparator)
    static boolean
    Checks if the specified CharSequence is null, empty, or contains only whitespace characters.
    static boolean
    isEmpty(boolean[] a)
    Checks if the specified boolean array is null or empty.
    static boolean
    isEmpty(byte[] a)
    Checks if the specified byte array is null or empty.
    static boolean
    isEmpty(char[] a)
    Checks if the specified char array is null or empty.
    static boolean
    isEmpty(double[] a)
    Checks if the specified double array is null or empty.
    static boolean
    isEmpty(float[] a)
    Checks if the specified float array is null or empty.
    static boolean
    isEmpty(int[] a)
    Checks if the specified int array is null or empty.
    static boolean
    isEmpty(long[] a)
    Checks if the specified long array is null or empty.
    static boolean
    isEmpty(short[] a)
    Checks if the specified short array is null or empty.
    static boolean
    Checks if the specified DataSet is null or empty.
    static boolean
    isEmpty(Multimap<?,?,?> m)
    Checks if the specified Multimap is null or empty.
    static boolean
    Checks if the specified Multiset is null or empty.
    static boolean
    Checks if the specified PrimitiveList is null or empty.
    static boolean
    Checks if the specified CharSequence is null or empty.
    static boolean
    Checks if the specified iterable is null or empty.
    static boolean
    Checks if the specified object array is null or empty.
    static boolean
    Checks if the specified Collection is null or empty.
    static boolean
    isEmpty(Iterator<?> iter)
    Checks if the specified iterator is null or empty.
    static boolean
    isEmpty(Map<?,?> m)
    Checks if the specified Map is null or empty.
    static boolean
    Returns true if the given Collections contain exactly the same elements with exactly the same cardinalities.
    static boolean
    Returns true if the specified boolean is Boolean.FALSE, not null or Boolean.TRUE.
    static boolean
    Returns true if the specified boolean is null or Boolean.TRUE.
    static boolean
    Returns true if the specified boolean is null or Boolean.FALSE.
    static boolean
    Returns true if subColl is a proper sub-collection of coll, that is, if the cardinality of e in subColl is less than or equal to the cardinality of e in coll, for each element e in subColl, and there is at least one element f such that the cardinality of f in coll is strictly greater than the cardinality of f in subColl.
    static boolean
    isSorted(boolean[] a)
    Checks if the specified boolean array is sorted in ascending order.
    static boolean
    isSorted(boolean[] a, int fromIndex, int toIndex)
    Checks if the specified range of the boolean array is sorted in ascending order.
    static boolean
    isSorted(byte[] a)
    Checks if the specified byte array is sorted in ascending order.
    static boolean
    isSorted(byte[] a, int fromIndex, int toIndex)
    Checks if the specified range of the byte array is sorted in ascending order.
    static boolean
    isSorted(char[] a)
    Checks if the specified char array is sorted in ascending order.
    static boolean
    isSorted(char[] a, int fromIndex, int toIndex)
    Checks if the specified range of the char array is sorted in ascending order.
    static boolean
    isSorted(double[] a)
    Checks if the specified double array is sorted in ascending order.
    static boolean
    isSorted(double[] a, int fromIndex, int toIndex)
    Checks if the specified range of the double array is sorted in ascending order.
    static boolean
    isSorted(float[] a)
    Checks if the specified float array is sorted in ascending order.
    static boolean
    isSorted(float[] a, int fromIndex, int toIndex)
    Checks if the specified range of the float array is sorted in ascending order.
    static boolean
    isSorted(int[] a)
    Checks if the specified integer array is sorted in ascending order.
    static boolean
    isSorted(int[] a, int fromIndex, int toIndex)
    Checks if the specified range of the integer array is sorted in ascending order.
    static boolean
    isSorted(long[] a)
    Checks if the specified long array is sorted in ascending order.
    static boolean
    isSorted(long[] a, int fromIndex, int toIndex)
    Checks if the specified range of the long array is sorted in ascending order.
    static boolean
    isSorted(short[] a)
    Checks if the specified byte short is sorted in ascending order.
    static boolean
    isSorted(short[] a, int fromIndex, int toIndex)
    Checks if the specified range of the short array is sorted in ascending order.
    static <T extends Comparable<? super T>>
    boolean
    isSorted(Collection<? extends T> c)
    Checks if the collection is sorted in ascending order (where null is smallest).
    static <T extends Comparable<? super T>>
    boolean
    isSorted(Collection<? extends T> c, int fromIndex, int toIndex)
    Checks if the specified range of the collection is sorted in ascending order (where null is smallest).
    static <T> boolean
    isSorted(Collection<? extends T> c, int fromIndex, int toIndex, Comparator<? super T> cmp)
    Checks if the specified range of the collection is sorted according to the order induced by the specified comparator.
    static <T> boolean
    isSorted(Collection<? extends T> c, Comparator<? super T> cmp)
    Checks if the collection is sorted according to the order induced by the specified comparator.
    static <T extends Comparable<? super T>>
    boolean
    isSorted(T[] a)
    Checks if the specified array is sorted in ascending order (where null is smallest).
    static <T extends Comparable<? super T>>
    boolean
    isSorted(T[] a, int fromIndex, int toIndex)
    Checks if the specified range of the array is sorted in ascending order (where null is smallest).
    static <T> boolean
    isSorted(T[] a, int fromIndex, int toIndex, Comparator<? super T> cmp)
    Checks if the specified range of the array is sorted according to the order induced by the specified comparator.
    static <T> boolean
    isSorted(T[] a, Comparator<? super T> cmp)
    Checks if the array is sorted according to the order induced by the specified comparator.
    static boolean
    isSubCollection(Collection<?> subColl, Collection<?> coll)
    Returns true if subColl is a sub-collection of coll, that is, if the cardinality of e in subColl is less than or equal to the cardinality of e in coll, for each element e in subColl.
    static boolean
    Returns true if the specified boolean is Boolean.TRUE, not null or Boolean.FALSE.
    static <T> Iterator<T>
    iterate(Iterable<? extends T> iterable)
    Returns an iterator over the elements in the specified iterable.
    static <T> ObjIterator<T>
    iterate(T[] a)
    Returns an iterator over the elements in the specified array.
    static <T> ObjIterator<T>
    iterate(T[] a, int fromIndex, int toIndex)
    Returns an iterator over the elements within specified range in the given array.
    static <T> List<Iterator<T>>
    iterateAll(Collection<? extends Iterable<? extends T>> iterables)
    Returns a list of iterators for each iterable in the specified collection of iterables.
    static String
    Converts the given JSON string to its XML string representation.
    static String
    json2Xml(String json, Class<?> transferType)
    Converts the given JSON string to its XML string representation.
    static byte
    kthLargest(byte[] a, int k)
    Returns the k-th largest element in the specified array.
    static byte
    kthLargest(byte[] a, int fromIndex, int toIndex, int k)
    Returns the k-th largest element within the specified range in the input array.
    static char
    kthLargest(char[] a, int k)
    Returns the k-th largest element in the specified array.
    static char
    kthLargest(char[] a, int fromIndex, int toIndex, int k)
    Returns the k-th largest element within the specified range in the input array.
    static double
    kthLargest(double[] a, int k)
    Returns the k-th largest element in the specified array.
    static double
    kthLargest(double[] a, int fromIndex, int toIndex, int k)
    Returns the k-th largest element within the specified range in the input array.
    static float
    kthLargest(float[] a, int k)
    Returns the k-th largest element in the specified array.
    static float
    kthLargest(float[] a, int fromIndex, int toIndex, int k)
    Returns the k-th largest element within the specified range in the input array.
    static int
    kthLargest(int[] a, int k)
    Returns the k-th largest element in the specified array.
    static int
    kthLargest(int[] a, int fromIndex, int toIndex, int k)
    Returns the k-th largest element within the specified range in the input array.
    static long
    kthLargest(long[] a, int k)
    Returns the k-th largest element in the specified array.
    static long
    kthLargest(long[] a, int fromIndex, int toIndex, int k)
    Returns the k-th largest element within the specified range in the input array.
    static short
    kthLargest(short[] a, int k)
    Returns the k-th largest element in the specified array.
    static short
    kthLargest(short[] a, int fromIndex, int toIndex, int k)
    Returns the k-th largest element within the specified range in the input array.
    static <T extends Comparable<? super T>>
    T
    kthLargest(Collection<? extends T> c, int k)
    Returns the k-th largest element in the specified collection.
    static <T extends Comparable<? super T>>
    T
    kthLargest(Collection<? extends T> c, int fromIndex, int toIndex, int k)
    Returns the k-th largest element within the specified range in the input collection.
    static <T> T
    kthLargest(Collection<? extends T> c, int fromIndex, int toIndex, int k, Comparator<? super T> cmp)
    Returns the k-th largest element within the specified range in the input collection according to the provided comparator.
    static <T> T
    kthLargest(Collection<? extends T> c, int k, Comparator<? super T> cmp)
    Returns the k-th largest element in the specified collection according to the provided comparator.
    static <T extends Comparable<? super T>>
    T
    kthLargest(T[] a, int k)
    Returns the k-th largest element in the specified array.
    static <T extends Comparable<? super T>>
    T
    kthLargest(T[] a, int fromIndex, int toIndex, int k)
    Returns the k-th largest element within the specified range in the input array.
    static <T> T
    kthLargest(T[] a, int fromIndex, int toIndex, int k, Comparator<? super T> cmp)
    Returns the k-th largest element within the specified range in the input array according to the provided comparator.
    static <T> T
    kthLargest(T[] a, int k, Comparator<? super T> cmp)
    Returns the k-th largest element in the specified array according to the provided comparator.
    static <T> u.Nullable<T>
    lastElement(Iterable<? extends T> c)
    Returns the last element in the given Iterable wrapped in a Nullable.
    static <T> u.Nullable<T>
    lastElement(Iterator<? extends T> iter)
    Returns the last element in the given Iterator wrapped in a Nullable.
    static <T> List<T>
    lastElements(Iterable<? extends T> c, int n)
    Returns a list containing the last n elements from the given Iterable.
    static <T> List<T>
    lastElements(Iterator<? extends T> iter, int n)
    Returns a list containing the last n elements from the given Iterator.
    static <K, V> u.Optional<Map.Entry<K,V>>
    lastEntry(Map<K,V> map)
    Returns the last entry from the given map.
    static int
    lastIndexOf(boolean[] a, boolean valueToFind)
    Returns the index of the last occurrence of the specified value in the array.
    static int
    lastIndexOf(boolean[] a, boolean valueToFind, int startIndexFromBack)
    Returns the index of the last occurrence of the specified value in the array, starting the search backwards from the specified index.
    static int
    lastIndexOf(byte[] a, byte valueToFind)
    Returns the index of the last occurrence of the specified value in the array.
    static int
    lastIndexOf(byte[] a, byte valueToFind, int startIndexFromBack)
    Returns the index of the last occurrence of the specified value in the array, starting the search backwards from the specified index.
    static int
    lastIndexOf(char[] a, char valueToFind)
    Returns the index of the last occurrence of the specified value in the array.
    static int
    lastIndexOf(char[] a, char valueToFind, int startIndexFromBack)
    Returns the index of the last occurrence of the specified value in the array, starting the search backwards from the specified index.
    static int
    lastIndexOf(double[] a, double valueToFind)
    Returns the index of the last occurrence of the specified value in the array.
    static int
    lastIndexOf(double[] a, double valueToFind, double tolerance)
    Finds the last index of the given value within a given tolerance in the array.
    static int
    lastIndexOf(double[] a, double valueToFind, double tolerance, int startIndexFromBack)
    Finds the last index of the given value in the array starting at the given index.
    static int
    lastIndexOf(double[] a, double valueToFind, int startIndexFromBack)
    Returns the index of the last occurrence of the specified value in the array, starting the search backwards from the specified index.
    static int
    lastIndexOf(float[] a, float valueToFind)
    Returns the index of the last occurrence of the specified value in the array.
    static int
    lastIndexOf(float[] a, float valueToFind, int startIndexFromBack)
    Returns the index of the last occurrence of the specified value in the array, starting the search backwards from the specified index.
    static int
    lastIndexOf(int[] a, int valueToFind)
    Returns the index of the last occurrence of the specified value in the array.
    static int
    lastIndexOf(int[] a, int valueToFind, int startIndexFromBack)
    Returns the index of the last occurrence of the specified value in the array, starting the search backwards from the specified index.
    static int
    lastIndexOf(long[] a, long valueToFind)
    Returns the index of the last occurrence of the specified value in the array.
    static int
    lastIndexOf(long[] a, long valueToFind, int startIndexFromBack)
    Returns the index of the last occurrence of the specified value in the array, starting the search backwards from the specified index.
    static int
    lastIndexOf(short[] a, short valueToFind)
    Returns the index of the last occurrence of the specified value in the array.
    static int
    lastIndexOf(short[] a, short valueToFind, int startIndexFromBack)
    Returns the index of the last occurrence of the specified value in the array, starting the search backwards from the specified index.
    static int
    lastIndexOf(Object[] a, Object valueToFind)
    Returns the index of the last occurrence of the specified value in the array.
    static int
    lastIndexOf(Object[] a, Object valueToFind, int startIndexFromBack)
    Returns the index of the last occurrence of the specified value in the array, starting the search backwards from the specified index.
    static int
    lastIndexOf(Collection<?> c, Object valueToFind)
    Returns the index of the last occurrence of the specified value in the specified collection.
    static int
    lastIndexOf(Collection<?> c, Object valueToFind, int startIndexFromBack)
    Returns the index of the last occurrence of the specified value in the specified collection, starting the search backwards from the specified index.
    static int
    lastIndexOfIgnoreCase(String[] a, String valueToFind)
    Returns the index of the last occurrence of the specified string in the array, ignoring case considerations.
    static int
    lastIndexOfIgnoreCase(String[] a, String valueToFind, int startIndexFromBack)
    Returns the index of the last occurrence of the specified string in the array, ignoring case considerations, starting the search backwards from the specified index.
    static int
    lastIndexOfSubList(List<?> sourceList, List<?> subListToFind)
    Returns the index of the last occurrence of the specified sublist in the source list.
    static int
    lastIndexOfSubList(List<?> sourceList, List<?> subListToFind, int startIndexFromBack)
    Returns the index of the last occurrence of the specified sublist in the source list, starting the search backwards from the specified index.
    static <T> u.Optional<T>
    lastNonNull(Iterable<? extends T> c)
    Returns the last non-null value from the provided iterable.
    static <T> u.Optional<T>
    lastNonNull(Iterator<? extends T> iter)
    Returns the last non-null value from the provided iterator.
    static <T> u.Optional<T>
    lastNonNull(T... a)
    Returns the last non-null value from the provided array of values.
    static <T> u.Optional<T>
    lastNonNull(T a, T b)
    Returns the last non-null value from the provided values.
    static <T> u.Optional<T>
    lastNonNull(T a, T b, T c)
    Returns the last non-null value from the provided values.
    static <T> T
    lastOrDefaultIfEmpty(Iterable<? extends T> c, T defaultValueForEmpty)
    Returns the last element of the given iterable if it is not empty, otherwise returns the specified default value.
    static <T> T
    lastOrDefaultIfEmpty(Iterator<? extends T> iter, T defaultValueForEmpty)
    Returns the last element of the given iterator if it is not empty, otherwise returns the specified default value.
    static <T> T
    lastOrDefaultIfEmpty(T[] a, T defaultValueForEmpty)
    Returns the last element of the given array if it is not empty, otherwise returns the specified default value.
    static <T> T
    lastOrNullIfEmpty(Iterable<? extends T> c)
    Returns the last element of the given iterable if it is not empty, otherwise returns null.
    static <T> T
    lastOrNullIfEmpty(Iterator<? extends T> iter)
    Returns the last element of the given iterator if it is not empty, otherwise returns null.
    static <T> T
    Returns the last element of the given array if it is not empty, otherwise returns null.
    static <T> Supplier<T>
    lazyInit(Supplier<T> supplier)
    Creates a lazy-initialized supplier from the provided supplier.
    static <T, E extends Exception>
    Throwables.Supplier<T,E>
    Creates a lazy-initialized supplier from the provided supplier.
    static int
    len(boolean[] a)
    Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
    static int
    len(byte[] a)
    Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
    static int
    len(char[] a)
    Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
    static int
    len(double[] a)
    Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
    static int
    len(float[] a)
    Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
    static int
    len(int[] a)
    Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
    static int
    len(long[] a)
    Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
    static int
    len(short[] a)
    Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
    static int
    Returns the length of the specified CharSequence, or 0 if it's empty or null.
    static int
    len(Object[] a)
    Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
    static <T extends Comparable<? super T>>
    boolean
    lessEqual(T a, T b)
    Compares two comparable objects to determine if the first is less than or equal to the second.
    static <T> boolean
    lessEqual(T a, T b, Comparator<? super T> cmp)
    Compares two objects using the specified comparator to determine if the first is less than or equal to the second.
    static <T extends Comparable<? super T>>
    boolean
    lessThan(T a, T b)
    Compares two comparable objects to determine if the first is less than the second.
    static <T> boolean
    lessThan(T a, T b, Comparator<? super T> cmp)
    Compares two objects using the specified comparator to determine if the first is less than the second.
    static <T, R> List<R>
    map(Iterable<? extends T> c, Function<? super T,? extends R> mapper)
    Transforms the elements in the specified iterable from type: {code T} to type: R by applying the specified Function<T, R> to each element.
    static <T, R, C extends Collection<R>>
    C
    map(Iterable<? extends T> c, Function<? super T,? extends R> mapper, IntFunction<? extends C> supplier)
    Transforms the elements in the specified iterable from type: {code T} to type: R by applying the specified Function<T, R> to each element.
    static <T, R> List<R>
    map(Collection<? extends T> c, int fromIndex, int toIndex, Function<? super T,? extends R> mapper)
    Transforms the elements within the specified range in the input collection from type: {code T} to type: R by applying the specified Function<T, R> to each element.
    static <T, R, C extends Collection<R>>
    C
    map(Collection<? extends T> c, int fromIndex, int toIndex, Function<? super T,? extends R> mapper, IntFunction<? extends C> supplier)
    Transforms the elements within the specified range in the input collection from type: {code T} to type: R by applying the specified Function<T, R> to each element.
    static <T, R> List<R>
    map(Iterator<? extends T> iter, Function<? super T,? extends R> mapper)
    Transforms the elements in the specified iterator from type: {code T} to type: R by applying the specified Function<T, R> to each element.
    static <T, R, C extends Collection<R>>
    C
    map(Iterator<? extends T> iter, Function<? super T,? extends R> mapper, IntFunction<? extends C> supplier)
    Transforms the elements in the specified iterator from type: {code T} to type: R by applying the specified Function<T, R> to each element.
    static <T, R> List<R>
    map(T[] a, int fromIndex, int toIndex, Function<? super T,? extends R> mapper)
    Transforms the elements within the specified range in the input array from type: {code T} to type: R by applying the specified Function<T, R> to each element.
    static <T, R, C extends Collection<R>>
    C
    map(T[] a, int fromIndex, int toIndex, Function<? super T,? extends R> mapper, IntFunction<? extends C> supplier)
    Transforms the elements within the specified range in the input array from type: {code T} to type: R by applying the specified Function<T, R> to each element.
    static <T, R> List<R>
    map(T[] a, Function<? super T,? extends R> mapper)
    Transforms the elements in the specified array from type: {code T} to type: R by applying the specified Function<T, R> to each element.
    static <T, R, C extends Collection<R>>
    C
    map(T[] a, Function<? super T,? extends R> mapper, IntFunction<? extends C> supplier)
    Transforms the elements in the specified array from type: {code T} to type: R by applying the specified Function<T, R> to each element.
    static <T, R> List<R>
    mapAndFilter(Iterable<? extends T> c, Function<? super T,? extends R> mapper, Predicate<? super R> filter)
    Maps and filters the elements in the given iterable.
    static <T, R, C extends Collection<R>>
    C
    mapAndFilter(Iterable<? extends T> c, Function<? super T,? extends R> mapper, Predicate<? super R> filter, IntFunction<? extends C> supplier)
    Maps and filters the elements in the given iterable.
    static <T> boolean[]
    mapToBoolean(Collection<? extends T> c, int fromIndex, int toIndex, ToBooleanFunction<? super T> mapper)
    Transforms the elements within the specified range in the input collection to boolean values using the specified ToBooleanFunction.
    static <T> boolean[]
    mapToBoolean(Collection<? extends T> c, ToBooleanFunction<? super T> mapper)
    Transforms the elements of the specified collection to boolean values using the specified ToBooleanFunction.
    static <T> boolean[]
    mapToBoolean(T[] a, int fromIndex, int toIndex, ToBooleanFunction<? super T> mapper)
    Transforms the elements within the specified range in the input array to boolean values using the specified ToBooleanFunction.
    static <T> boolean[]
    mapToBoolean(T[] a, ToBooleanFunction<? super T> mapper)
    Transforms the elements of the specified array to boolean values using the specified ToBooleanFunction.
    static <T> byte[]
    mapToByte(Collection<? extends T> c, int fromIndex, int toIndex, ToByteFunction<? super T> mapper)
    Transforms the elements within the specified range in the input collection to byte values using the specified ToByteFunction.
    static <T> byte[]
    mapToByte(Collection<? extends T> c, ToByteFunction<? super T> mapper)
    Transforms the elements of the specified collection to byte values using the specified ToByteFunction.
    static <T> byte[]
    mapToByte(T[] a, int fromIndex, int toIndex, ToByteFunction<? super T> mapper)
    Transforms the elements within the specified range in the input array to byte values using the specified ToByteFunction.
    static <T> byte[]
    mapToByte(T[] a, ToByteFunction<? super T> mapper)
    Transforms the elements of the specified array to byte values using the specified ToByteFunction.
    static <T> char[]
    mapToChar(Collection<? extends T> c, int fromIndex, int toIndex, ToCharFunction<? super T> mapper)
    Transforms the elements within the specified range in the input collection to char values using the specified ToCharFunction.
    static <T> char[]
    mapToChar(Collection<? extends T> c, ToCharFunction<? super T> mapper)
    Transforms the elements of the specified collection to char values using the specified ToCharFunction.
    static <T> char[]
    mapToChar(T[] a, int fromIndex, int toIndex, ToCharFunction<? super T> mapper)
    Transforms the elements within the specified range in the input array to char values using the specified ToCharFunction.
    static <T> char[]
    mapToChar(T[] a, ToCharFunction<? super T> mapper)
    Transforms the elements of the specified array to char values using the specified ToCharFunction.
    static double[]
    mapToDouble(int[] a, IntToDoubleFunction mapper)
    Transforms the int values in the specified array to double values using the specified IntToDoubleFunction.
    static double[]
    mapToDouble(long[] a, LongToDoubleFunction mapper)
    Transforms the long values in the specified array to double values using the specified IntToDoubleFunction.
    static <T> double[]
    mapToDouble(Collection<? extends T> c, int fromIndex, int toIndex, ToDoubleFunction<? super T> mapper)
    Transforms the elements within the specified range in the input collection to double values using the specified ToDoubleFunction.
    static <T> double[]
    mapToDouble(Collection<? extends T> c, ToDoubleFunction<? super T> mapper)
    Transforms the elements of the specified collection to double values using the specified ToDoubleFunction.
    static <T> double[]
    mapToDouble(T[] a, int fromIndex, int toIndex, ToDoubleFunction<? super T> mapper)
    Transforms the elements within the specified range in the input array to double values using the specified ToDoubleFunction.
    static <T> double[]
    mapToDouble(T[] a, ToDoubleFunction<? super T> mapper)
    Transforms the elements of the specified array to double values using the specified ToDoubleFunction.
    static <T> float[]
    mapToFloat(Collection<? extends T> c, int fromIndex, int toIndex, ToFloatFunction<? super T> mapper)
    Transforms the elements within the specified range in the input collection to float values using the specified ToFloatFunction.
    static <T> float[]
    mapToFloat(Collection<? extends T> c, ToFloatFunction<? super T> mapper)
    Transforms the elements of the specified collection to float values using the specified ToFloatFunction.
    static <T> float[]
    mapToFloat(T[] a, int fromIndex, int toIndex, ToFloatFunction<? super T> mapper)
    Transforms the elements within the specified range in the input array to float values using the specified ToFloatFunction.
    static <T> float[]
    mapToFloat(T[] a, ToFloatFunction<? super T> mapper)
    Transforms the elements of the specified array to float values using the specified ToFloatFunction.
    static int[]
    mapToInt(double[] a, DoubleToIntFunction mapper)
    Transforms the double values in the specified array to int values using the specified DoubleToIntFunction.
    static int[]
    mapToInt(long[] a, LongToIntFunction mapper)
    Transforms the long values in the specified array to int values using the specified LongToIntFunction.
    static <T> int[]
    mapToInt(Collection<? extends T> c, int fromIndex, int toIndex, ToIntFunction<? super T> mapper)
    Transforms the elements within the specified range in the input collection to int values using the specified ToIntFunction.
    static <T> int[]
    mapToInt(Collection<? extends T> c, ToIntFunction<? super T> mapper)
    Transforms the elements of the specified collection to int values using the specified ToIntFunction.
    static <T> int[]
    mapToInt(T[] a, int fromIndex, int toIndex, ToIntFunction<? super T> mapper)
    Transforms the elements within the specified range in the input array to int values using the specified ToIntFunction.
    static <T> int[]
    mapToInt(T[] a, ToIntFunction<? super T> mapper)
    Transforms the elements of the specified array to int values using the specified ToIntFunction.
    static long[]
    mapToLong(double[] a, DoubleToLongFunction mapper)
    Transforms the double values in the specified array to long values using the specified DoubleToLongFunction.
    static long[]
    mapToLong(int[] a, IntToLongFunction mapper)
    Transforms the int values in the specified array to long values using the specified IntToLongFunction.
    static <T> long[]
    mapToLong(Collection<? extends T> c, int fromIndex, int toIndex, ToLongFunction<? super T> mapper)
    Transforms the elements within the specified range in the input collection to long values using the specified ToLongFunction.
    static <T> long[]
    mapToLong(Collection<? extends T> c, ToLongFunction<? super T> mapper)
    Transforms the elements of the specified collection to long values using the specified ToLongFunction.
    static <T> long[]
    mapToLong(T[] a, int fromIndex, int toIndex, ToLongFunction<? super T> mapper)
    Transforms the elements within the specified range in the input array to long values using the specified ToLongFunction.
    static <T> long[]
    mapToLong(T[] a, ToLongFunction<? super T> mapper)
    Transforms the elements of the specified array to long values using the specified ToLongFunction.
    static <T> short[]
    mapToShort(Collection<? extends T> c, int fromIndex, int toIndex, ToShortFunction<? super T> mapper)
    Transforms the elements within the specified range in the input collection to short values using the specified ToShortFunction.
    static <T> short[]
    mapToShort(Collection<? extends T> c, ToShortFunction<? super T> mapper)
    Transforms the elements of the specified collection to short values using the specified ToShortFunction.
    static <T> short[]
    mapToShort(T[] a, int fromIndex, int toIndex, ToShortFunction<? super T> mapper)
    Transforms the elements within the specified range in the input array to short values using the specified ToShortFunction.
    static <T> short[]
    mapToShort(T[] a, ToShortFunction<? super T> mapper)
    Transforms the elements of the specified array to short values using the specified ToShortFunction.
    static byte
    max(byte... a)
    Returns the biggest byte value in the specified array of byte values.
    static byte
    max(byte[] a, int fromIndex, int toIndex)
    Returns the biggest byte value within the given range in the specified array of byte values.
    static byte
    max(byte a, byte b)
    Returns the bigger of two byte values.
    static byte
    max(byte a, byte b, byte c)
    Returns the biggest value among the provided values.
    static char
    max(char... a)
    Returns the biggest char value in the specified array of char values.
    static char
    max(char[] a, int fromIndex, int toIndex)
    Returns the biggest char value within the given range in the specified array of char values.
    static char
    max(char a, char b)
    Returns the bigger of two char values.
    static char
    max(char a, char b, char c)
    Returns the biggest value among the provided values.
    static double
    max(double... a)
    Returns the biggest double value in the specified array of double values.
    static double
    max(double[] a, int fromIndex, int toIndex)
    Returns the biggest double value within the given range in the specified array of double values.
    static double
    max(double a, double b)
    Returns the bigger of two double values.
    static double
    max(double a, double b, double c)
    Returns the biggest value among the provided values.
    static float
    max(float... a)
    Returns the biggest float value in the specified array of float values.
    static float
    max(float[] a, int fromIndex, int toIndex)
    Returns the biggest float value within the given range in the specified array of float values.
    static float
    max(float a, float b)
    Returns the bigger of two float values.
    static float
    max(float a, float b, float c)
    Returns the biggest value among the provided values.
    static int
    max(int... a)
    Returns the biggest int value in the specified array of int values.
    static int
    max(int[] a, int fromIndex, int toIndex)
    Returns the biggest int value within the given range in the specified array of int values.
    static int
    max(int a, int b)
    Returns the bigger of two int values.
    static int
    max(int a, int b, int c)
    Returns the biggest value among the provided values.
    static long
    max(long... a)
    Returns the biggest long value in the specified array of long values.
    static long
    max(long[] a, int fromIndex, int toIndex)
    Returns the biggest long value within the given range in the specified array of long values.
    static long
    max(long a, long b)
    Returns the bigger of two long values.
    static long
    max(long a, long b, long c)
    Returns the biggest value among the provided values.
    static short
    max(short... a)
    Returns the biggest short value in the specified array of short values.
    static short
    max(short[] a, int fromIndex, int toIndex)
    Returns the biggest short value within the given range in the specified array of short values.
    static short
    max(short a, short b)
    Returns the bigger of two short values.
    static short
    max(short a, short b, short c)
    Returns the biggest value among the provided values.
    static <T extends Comparable<? super T>>
    T
    max(Iterable<? extends T> c)
    Returns the biggest element in the specified iterable based on their natural ordering.
    static <T> T
    max(Iterable<? extends T> c, Comparator<? super T> cmp)
    Returns the biggest element in the specified iterable according to the provided comparator.
    static <T extends Comparable<? super T>>
    T
    max(Collection<? extends T> c, int fromIndex, int toIndex)
    Returns the biggest element within the given range in the specified collection according to the provided comparator.
    static <T> T
    max(Collection<? extends T> c, int fromIndex, int toIndex, Comparator<? super T> cmp)
    Returns the biggest element within the given range in the specified collection according to the provided comparator.
    static <T extends Comparable<? super T>>
    T
    max(Iterator<? extends T> iter)
    Returns the biggest element in the specified iterator based on their natural ordering.
    static <T> T
    max(Iterator<? extends T> iter, Comparator<? super T> cmp)
    Returns the biggest element in the specified iterator according to the provided comparator.
    static <T extends Comparable<? super T>>
    T
    max(T[] a)
    Returns the biggest element in the specified array based on their natural ordering.
    static <T extends Comparable<? super T>>
    T
    max(T[] a, int fromIndex, int toIndex)
    Returns the biggest element within the given range in the specified array based on their natural ordering.
    static <T> T
    max(T[] a, int fromIndex, int toIndex, Comparator<? super T> cmp)
    Returns the biggest element within the given range in the specified array according to the provided comparator.
    static <T> T
    max(T[] a, Comparator<? super T> cmp)
    Returns the biggest element in the specified array according to the provided comparator.
    static <T extends Comparable<? super T>>
    T
    max(T a, T b)
    Returns the bigger value of the two provided values based on their natural ordering.
    static <T> T
    max(T a, T b, Comparator<? super T> cmp)
    Returns the bigger value of the two provided values according to the provided comparator.
    static <T extends Comparable<? super T>>
    T
    max(T a, T b, T c)
    Returns the biggest value among the provided values based on their natural ordering.
    static <T> T
    max(T a, T b, T c, Comparator<? super T> cmp)
    Returns the biggest value among the provided values according to the provided comparator.
    static <T extends Comparable<? super T>>
    List<T>
    maxAll(Iterable<? extends T> c)
    Returns a list containing the biggest elements in the specified iterable based on their natural ordering.
    static <T> List<T>
    maxAll(Iterable<? extends T> c, Comparator<? super T> cmp)
    Returns a list containing all biggest elements in the specified iterable according to the provided comparator.
    static <T extends Comparable<? super T>>
    List<T>
    maxAll(Iterator<? extends T> iter)
    Returns a list containing the biggest elements in the specified iterator based on their natural ordering.
    static <T> List<T>
    maxAll(Iterator<? extends T> iter, Comparator<? super T> cmp)
    Returns a list containing all biggest elements in the specified iterator according to the provided comparator.
    static <T extends Comparable<? super T>>
    List<T>
    maxAll(T[] a)
    Returns a list containing the biggest elements in the specified array based on their natural ordering.
    static <T> List<T>
    maxAll(T[] a, Comparator<? super T> cmp)
    Returns a list containing all biggest elements in the specified array according to the provided comparator.
    static <T> double
    maxDoubleOrDefaultIfEmpty(Iterable<? extends T> c, ToDoubleFunction<? super T> valueExtractor, double defaultValue)
    Returns the maximum double value extracted from the iterable or a default value if the iterable is null or empty.
    static <T> double
    maxDoubleOrDefaultIfEmpty(Iterator<? extends T> iter, ToDoubleFunction<? super T> valueExtractor, double defaultValue)
    Returns the maximum double value extracted from the iterator or a default value if the iterator is null or empty.
    static <T> double
    maxDoubleOrDefaultIfEmpty(T[] a, ToDoubleFunction<? super T> valueExtractor, double defaultValue)
    Returns the maximum double value extracted from the array or a default value if the array is null or empty.
    static <T> int
    maxIntOrDefaultIfEmpty(Iterable<? extends T> c, ToIntFunction<? super T> valueExtractor, int defaultValue)
    Returns the maximum integer value extracted from the iterable or a default value if the iterable is null or empty.
    static <T> int
    maxIntOrDefaultIfEmpty(Iterator<? extends T> iter, ToIntFunction<? super T> valueExtractor, int defaultValue)
    Returns the maximum integer value extracted from the iterator or a default value if the iterator is null or empty.
    static <T> int
    maxIntOrDefaultIfEmpty(T[] a, ToIntFunction<? super T> valueExtractor, int defaultValue)
    Returns the maximum integer value extracted from the array or a default value if the array is null or empty.
    static <T> long
    maxLongOrDefaultIfEmpty(Iterable<? extends T> c, ToLongFunction<? super T> valueExtractor, long defaultValue)
    Returns the maximum long value extracted from the iterable or a default value if the iterable is null or empty.
    static <T> long
    maxLongOrDefaultIfEmpty(Iterator<? extends T> iter, ToLongFunction<? super T> valueExtractor, long defaultValue)
    Returns the maximum long value extracted from the iterator or a default value if the iterator is null or empty.
    static <T> long
    maxLongOrDefaultIfEmpty(T[] a, ToLongFunction<? super T> valueExtractor, long defaultValue)
    Returns the maximum long value extracted from the array or a default value if the array is null or empty.
    static <T, R extends Comparable<? super R>>
    R
    maxOrDefaultIfEmpty(Iterable<? extends T> c, Function<? super T,? extends R> valueExtractor, R defaultValue)
    Returns the maximum value extracted from the specified iterable or a default value if the iterable is null or empty.
    static <T, R extends Comparable<? super R>>
    R
    maxOrDefaultIfEmpty(Iterator<? extends T> iter, Function<? super T,? extends R> valueExtractor, R defaultValue)
    Returns the maximum value extracted from the specified iterator or a default value if the iterator is null or empty.
    static <T, R extends Comparable<? super R>>
    R
    maxOrDefaultIfEmpty(T[] a, Function<? super T,? extends R> valueExtractor, R defaultValue)
    Returns the maximum value extracted from the specified array or a default value if the array is null or empty.
    static byte
    median(byte... a)
    Returns the (sizeOfRange / 2 + 1) largest value in the specified array.
    static byte
    median(byte[] a, int fromIndex, int toIndex)
    Returns the (sizeOfRange / 2 + 1) largest value within the given range in the specified array
    static byte
    median(byte a, byte b, byte c)
    Returns the median value of the three specified byte values.
    static char
    median(char... a)
    Returns the (sizeOfRange / 2 + 1) largest value in the specified array.
    static char
    median(char[] a, int fromIndex, int toIndex)
    Returns the (sizeOfRange / 2 + 1) largest value within the given range in the specified array
    static char
    median(char a, char b, char c)
    Returns the median value of the three specified char values.
    static double
    median(double... a)
    Returns the (sizeOfRange / 2 + 1) largest value in the specified array.
    static double
    median(double[] a, int fromIndex, int toIndex)
    Returns the (sizeOfRange / 2 + 1) largest value within the given range in the specified array
    static double
    median(double a, double b, double c)
    Returns the median value of the three specified double values.
    static float
    median(float... a)
    Returns the (sizeOfRange / 2 + 1) largest value in the specified array.
    static float
    median(float[] a, int fromIndex, int toIndex)
    Returns the (sizeOfRange / 2 + 1) largest value within the given range in the specified array
    static float
    median(float a, float b, float c)
    Returns the median value of the three specified float values.
    static int
    median(int... a)
    Returns the (sizeOfRange / 2 + 1) largest value in the specified array.
    static int
    median(int[] a, int fromIndex, int toIndex)
    Returns the (sizeOfRange / 2 + 1) largest value within the given range in the specified array
    static int
    median(int a, int b, int c)
    Returns the median value of the three specified int values.
    static long
    median(long... a)
    Returns the (sizeOfRange / 2 + 1) largest value in the specified array.
    static long
    median(long[] a, int fromIndex, int toIndex)
    Returns the (sizeOfRange / 2 + 1) largest value within the given range in the specified array
    static long
    median(long a, long b, long c)
    Returns the median value of the three specified long values.
    static short
    median(short... a)
    Returns the (sizeOfRange / 2 + 1) largest value in the specified array.
    static short
    median(short[] a, int fromIndex, int toIndex)
    Returns the (sizeOfRange / 2 + 1) largest value within the given range in the specified array
    static short
    median(short a, short b, short c)
    Returns the median value of the three specified short values.
    static <T extends Comparable<? super T>>
    T
    median(Collection<? extends T> c)
    Returns the (sizeOfRange / 2 + 1) largest element in the specified collection according to the provided comparator.
    static <T extends Comparable<? super T>>
    T
    median(Collection<? extends T> c, int fromIndex, int toIndex)
    Returns the (sizeOfRange / 2 + 1) largest element within the specified range in the input collection according to the provided comparator.
    static <T> T
    median(Collection<? extends T> c, int fromIndex, int toIndex, Comparator<? super T> cmp)
    Returns the (sizeOfRange / 2 + 1) largest element within the specified range in the input collection according to the provided comparator.
    static <T> T
    median(Collection<? extends T> c, Comparator<? super T> cmp)
    Returns the (sizeOfRange / 2 + 1) largest element in the specified collection according to the provided comparator.
    static <T extends Comparable<? super T>>
    T
    median(T[] a)
    Returns the (sizeOfRange / 2 + 1) largest value in the specified array.
    static <T extends Comparable<? super T>>
    T
    median(T[] a, int fromIndex, int toIndex)
    Returns the (sizeOfRange / 2 + 1) largest value within the given range in the specified array
    static <T> T
    median(T[] a, int fromIndex, int toIndex, Comparator<? super T> cmp)
    Returns the (sizeOfRange / 2 + 1) largest element within the specified range in the input array according to the provided comparator.
    static <T> T
    median(T[] a, Comparator<? super T> cmp)
    Returns the (sizeOfRange / 2 + 1) largest element in the specified array according to the provided comparator.
    static <T extends Comparable<? super T>>
    T
    median(T a, T b, T c)
    Returns the median of the provided values based on their natural ordering.
    static <T> T
    median(T a, T b, T c, Comparator<? super T> cmp)
    Returns the median of the provided values according to the provided comparator.
    static DataSet
    Merges two given DataSets into a single DataSet.
    static DataSet
    Merges three given DataSets into a single DataSet.
    static <T> List<T>
    merge(Iterable<? extends T> a, Iterable<? extends T> b, BiFunction<? super T,? super T,MergeResult> nextSelector)
    Merges two the input iterables into a list based where the order of the elements is determined by the given selector function.
    static <T> T
    merge(Object sourceBean, T targetBean)
    Merges the properties from the source object into the target object.
    static <T> T
    merge(Object sourceBean, T targetBean, boolean ignoreUnmatchedProperty, Set<String> ignoredPropNames)
    Merges the properties from the source object into the target object, except the properties specified in the ignoredPropNames set.
    static <T> T
    merge(Object sourceBean, T targetBean, boolean ignoreUnmatchedProperty, Set<String> ignoredPropNames, BinaryOperator<?> mergeFunc)
    Merges the properties from the source object into the target object using the specified merge function, except the properties specified in the ignoredPropNames set.
    static <T> T
    merge(Object sourceBean, T targetBean, Collection<String> selectPropNames)
    Merges the selected properties from the source object into the target object.
    static <T> T
    merge(Object sourceBean, T targetBean, Collection<String> selectPropNames, BinaryOperator<?> mergeFunc)
    Merges the selected properties from the source object into the target object using the specified merge function.
    static <T> T
    merge(Object sourceBean, T targetBean, Collection<String> selectPropNames, Function<String,String> propNameConverter)
    Merges the selected properties from the source object into the target object.
    static <T> T
    merge(Object sourceBean, T targetBean, Collection<String> selectPropNames, Function<String,String> propNameConverter, BinaryOperator<?> mergeFunc)
    Merges the selected properties from the source object into the target object using the specified merge function.
    static <T> T
    merge(Object sourceBean, T targetBean, BinaryOperator<?> mergeFunc)
    Merges the properties from the source object into the target object using the specified merge function.
    static <T> T
    merge(Object sourceBean, T targetBean, BiPredicate<? super String,?> propFilter)
    Merges the filtered properties from the source object into the target object, The source object's properties will overwrite the same properties in the target object.
    static <T> T
    merge(Object sourceBean, T targetBean, BiPredicate<? super String,?> propFilter, BinaryOperator<?> mergeFunc)
    Merges the filtered properties from the source object into the target object using the specified merge function.
    static <T> T
    merge(Object sourceBean, T targetBean, BiPredicate<? super String,?> propFilter, Function<String,String> propNameConverter)
    Merges the filtered properties from the source object into the target object using the specified merge function.
    static <T> T
    merge(Object sourceBean, T targetBean, BiPredicate<? super String,?> propFilter, Function<String,String> propNameConverter, BinaryOperator<?> mergeFunc)
    Merges the filtered properties from the source object into the target object using the specified merge function.
    static <T> T
    merge(Object sourceBean, T targetBean, Function<String,String> propNameConverter, BinaryOperator<?> mergeFunc)
    Merges the properties from the source object into the target object using the specified merge function.
    static DataSet
    merge(Collection<? extends DataSet> dss)
    Merges a collection of DataSets into a single DataSet.
    static DataSet
    merge(Collection<? extends DataSet> dss, boolean requiresSameColumns)
    Merges a collection of DataSets into a single DataSet.
    static <T> List<T>
    merge(Collection<? extends Iterable<? extends T>> c, BiFunction<? super T,? super T,MergeResult> nextSelector)
    Merges multiple iterables into a list based where the order of the elements is determined by the given selector function.
    static <T, C extends Collection<T>>
    C
    merge(Collection<? extends Iterable<? extends T>> c, BiFunction<? super T,? super T,MergeResult> nextSelector, IntFunction<? extends C> supplier)
    Merges multiple iterables into a list based where the order of the elements is determined by the given selector function.
    static <T> List<T>
    merge(T[] a, T[] b, BiFunction<? super T,? super T,MergeResult> nextSelector)
    Merges two the input arrays into a list based where the order of the elements is determined by the given selector function.
    static byte
    min(byte... a)
    Returns the smallest byte value in the specified array.
    static byte
    min(byte[] a, int fromIndex, int toIndex)
    Returns the smallest byte value within the specified range in the input array.
    static byte
    min(byte a, byte b)
    Returns the smaller of two input byte values.
    static byte
    min(byte a, byte b, byte c)
    Returns the smallest of the three input byte values.
    static char
    min(char... a)
    Returns the smallest char value in the specified array.
    static char
    min(char[] a, int fromIndex, int toIndex)
    Returns the smallest char value within the specified range in the input array.
    static char
    min(char a, char b)
    Returns the smaller of two input char values.
    static char
    min(char a, char b, char c)
    Returns the smallest of the three input char values.
    static double
    min(double... a)
    Returns the smallest double value in the specified array.
    static double
    min(double[] a, int fromIndex, int toIndex)
    Returns the smallest double value within the specified range in the input array.
    static double
    min(double a, double b)
    Returns the smaller of two input double values.
    static double
    min(double a, double b, double c)
    Returns the smallest of the three input double values.
    static float
    min(float... a)
    Returns the smallest float value in the specified array.
    static float
    min(float[] a, int fromIndex, int toIndex)
    Returns the smallest float value within the specified range in the input array.
    static float
    min(float a, float b)
    Returns the smaller of two input float values.
    static float
    min(float a, float b, float c)
    Returns the smallest of the three input float values.
    static int
    min(int... a)
    Returns the smallest int value in the specified array.
    static int
    min(int[] a, int fromIndex, int toIndex)
    Returns the smallest int value within the specified range in the input array.
    static int
    min(int a, int b)
    Returns the smaller of two input int values.
    static int
    min(int a, int b, int c)
    Returns the smallest of the three input int values.
    static long
    min(long... a)
    Returns the smallest long value in the specified array.
    static long
    min(long[] a, int fromIndex, int toIndex)
    Returns the smallest long value within the specified range in the input array.
    static long
    min(long a, long b)
    Returns the smaller of two input long values.
    static long
    min(long a, long b, long c)
    Returns the smallest of the three input long values.
    static short
    min(short... a)
    Returns the smallest short value in the specified array.
    static short
    min(short[] a, int fromIndex, int toIndex)
    Returns the smallest short value within the specified range in the input array.
    static short
    min(short a, short b)
    Returns the smaller of two input short values.
    static short
    min(short a, short b, short c)
    Returns the smallest of the three input short values.
    static <T extends Comparable<? super T>>
    T
    min(Iterable<? extends T> c)
    Returns the smallest value in the specified iterable based on their natural ordering.
    static <T> T
    min(Iterable<? extends T> c, Comparator<? super T> cmp)
    Returns the smallest value in the specified iterable according to the provided comparator.
    static <T extends Comparable<? super T>>
    T
    min(Collection<? extends T> c, int fromIndex, int toIndex)
    Returns the smallest value within the specified range in the input collection based on their natural ordering.
    static <T> T
    min(Collection<? extends T> c, int fromIndex, int toIndex, Comparator<? super T> cmp)
    Returns the smallest value within the specified range in the input collection according to the provided comparator.
    static <T extends Comparable<? super T>>
    T
    min(Iterator<? extends T> iter)
    Returns the smallest value in the specified iterator based on their natural ordering.
    static <T> T
    min(Iterator<? extends T> iter, Comparator<? super T> cmp)
    Returns the smallest value in the specified iterator according to the provided comparator.
    static <T extends Comparable<? super T>>
    T
    min(T[] a)
    Returns the smallest value in the specified array based on their natural ordering.
    static <T extends Comparable<? super T>>
    T
    min(T[] a, int fromIndex, int toIndex)
    Returns the smallest value within the specified range in the input array based on their natural ordering.
    static <T> T
    min(T[] a, int fromIndex, int toIndex, Comparator<? super T> cmp)
    Returns the smallest value within the specified range in the input array according to the provided comparator.
    static <T> T
    min(T[] a, Comparator<? super T> cmp)
    Returns the smallest value in the specified array according to the provided comparator.
    static <T extends Comparable<? super T>>
    T
    min(T a, T b)
    Returns the smaller of two input comparable values.
    static <T> T
    min(T a, T b, Comparator<? super T> cmp)
    Returns the smaller of two input values based on the specified comparator.
    static <T extends Comparable<? super T>>
    T
    min(T a, T b, T c)
    Returns the smallest of the three input comparable values.
    static <T> T
    min(T a, T b, T c, Comparator<? super T> cmp)
    Returns the smallest of the three input values based on the specified comparator.
    static <T extends Comparable<? super T>>
    List<T>
    minAll(Iterable<? extends T> c)
    Returns a list containing the smallest elements in the specified iterable based on their natural ordering.
    static <T> List<T>
    minAll(Iterable<? extends T> c, Comparator<? super T> cmp)
    Returns a list containing the smallest elements in the specified iterable according to the provided comparator.
    static <T extends Comparable<? super T>>
    List<T>
    minAll(Iterator<? extends T> iter)
    Returns a list containing the smallest elements in the specified iterator based on their natural ordering.
    static <T> List<T>
    minAll(Iterator<? extends T> iter, Comparator<? super T> cmp)
    Returns a list containing the smallest elements in the specified iterator according to the provided comparator.
    static <T extends Comparable<? super T>>
    List<T>
    minAll(T[] a)
    Returns a list containing the smallest elements in the specified array based on their natural ordering.
    static <T> List<T>
    minAll(T[] a, Comparator<? super T> cmp)
    Returns a list containing the smallest elements in the specified array according to the provided comparator.
    static <T> double
    minDoubleOrDefaultIfEmpty(Iterable<? extends T> c, ToDoubleFunction<? super T> valueExtractor, double defaultValue)
    Returns the minimum double value extracted from the specified iterable or a default value if the iterable is null or empty.
    static <T> double
    minDoubleOrDefaultIfEmpty(Iterator<? extends T> iter, ToDoubleFunction<? super T> valueExtractor, double defaultValue)
    Returns the minimum double value extracted from the specified iterator or a default value if the iterator is null or empty.
    static <T> double
    minDoubleOrDefaultIfEmpty(T[] a, ToDoubleFunction<? super T> valueExtractor, double defaultValue)
    Returns the minimum double value extracted from the specified array or a default value if the array is null or empty.
    static <T> int
    minIntOrDefaultIfEmpty(Iterable<? extends T> c, ToIntFunction<? super T> valueExtractor, int defaultValue)
    Returns the minimum integer value extracted from the specified iterable or a default value if the iterable is null or empty.
    static <T> int
    minIntOrDefaultIfEmpty(Iterator<? extends T> iter, ToIntFunction<? super T> valueExtractor, int defaultValue)
    Returns the minimum integer value extracted from the specified iterator or a default value if the iterator is null or empty.
    static <T> int
    minIntOrDefaultIfEmpty(T[] a, ToIntFunction<? super T> valueExtractor, int defaultValue)
    Returns the minimum integer value extracted from the array or a default value if the array is null or empty.
    static <T> long
    minLongOrDefaultIfEmpty(Iterable<? extends T> c, ToLongFunction<? super T> valueExtractor, long defaultValue)
    Returns the minimum long value extracted from the specified iterable or a default value if the iterable is null or empty.
    static <T> long
    minLongOrDefaultIfEmpty(Iterator<? extends T> iter, ToLongFunction<? super T> valueExtractor, long defaultValue)
    Returns the minimum long value extracted from the specified iterator or a default value if the iterator is null or empty.
    static <T> long
    minLongOrDefaultIfEmpty(T[] a, ToLongFunction<? super T> valueExtractor, long defaultValue)
    Returns the minimum long value extracted from the specified array or a default value if the array is null or empty.
    static <T extends Comparable<? super T>>
    Pair<T,T>
    minMax(Iterable<? extends T> c)
    Returns a Pair object containing the minimum and maximum values in the specified iterable based on their natural ordering.
    static <T> Pair<T,T>
    minMax(Iterable<? extends T> c, Comparator<? super T> cmp)
    Returns a Pair object containing the minimum and maximum values in the specified iterable according to the provided comparator.
    static <T extends Comparable<? super T>>
    Pair<T,T>
    minMax(Iterator<? extends T> iter)
    Returns a Pair object containing the minimum and maximum values in the specified iterator based on their natural ordering.
    static <T> Pair<T,T>
    minMax(Iterator<? extends T> iter, Comparator<? super T> cmp)
    Returns a Pair object containing the minimum and maximum values in the specified iterator according to the provided comparator.
    static <T extends Comparable<? super T>>
    Pair<T,T>
    minMax(T[] a)
    Returns a Pair object containing the minimum and maximum values in the specified array based on their natural ordering.
    static <T> Pair<T,T>
    minMax(T[] a, Comparator<? super T> cmp)
    Returns a Pair object containing the minimum and maximum values in the specified array according to the provided comparator.
    static <T, R extends Comparable<? super R>>
    R
    minOrDefaultIfEmpty(Iterable<? extends T> c, Function<? super T,? extends R> valueExtractor, R defaultValue)
    Returns the minimum value extracted from the specified iterable or a default value if the iterable is null or empty.
    static <T, R extends Comparable<? super R>>
    R
    minOrDefaultIfEmpty(Iterator<? extends T> iter, Function<? super T,? extends R> valueExtractor, R defaultValue)
    Returns the minimum value extracted from the specified iterator or a default value if the iterator is null or empty.
    static <T, R extends Comparable<? super R>>
    R
    minOrDefaultIfEmpty(T[] a, Function<? super T,? extends R> valueExtractor, R defaultValue)
    Returns the minimum value extracted from the specified array or a default value if the array is null or empty.
    static int
    mismatch(boolean[] a, boolean[] b)
    Finds and returns the index of the first mismatch between two arrays.
    static int
    mismatch(boolean[] a, int fromIndexA, boolean[] b, int fromIndexB, int len)
    Finds and returns the index of the first mismatch between two boolean arrays starting from specified indices.
    static int
    mismatch(byte[] a, byte[] b)
    Finds and returns the index of the first mismatch between two arrays.
    static int
    mismatch(byte[] a, int fromIndexA, byte[] b, int fromIndexB, int len)
    Finds and returns the index of the first mismatch between two byte arrays starting from specified indices.
    static int
    mismatch(char[] a, char[] b)
    Finds and returns the index of the first mismatch between two arrays.
    static int
    mismatch(char[] a, int fromIndexA, char[] b, int fromIndexB, int len)
    Finds and returns the index of the first mismatch between two char arrays starting from specified indices.
    static int
    mismatch(double[] a, double[] b)
    Finds and returns the index of the first mismatch between two arrays.
    static int
    mismatch(double[] a, int fromIndexA, double[] b, int fromIndexB, int len)
    Finds and returns the index of the first mismatch between two double arrays starting from specified indices.
    static int
    mismatch(float[] a, float[] b)
    Finds and returns the index of the first mismatch between two arrays.
    static int
    mismatch(float[] a, int fromIndexA, float[] b, int fromIndexB, int len)
    Finds and returns the index of the first mismatch between two float arrays starting from specified indices.
    static int
    mismatch(int[] a, int[] b)
    Finds and returns the index of the first mismatch between two arrays.
    static int
    mismatch(int[] a, int fromIndexA, int[] b, int fromIndexB, int len)
    Finds and returns the index of the first mismatch between two int arrays starting from specified indices.
    static int
    mismatch(long[] a, int fromIndexA, long[] b, int fromIndexB, int len)
    Finds and returns the index of the first mismatch between two long arrays starting from specified indices.
    static int
    mismatch(long[] a, long[] b)
    Finds and returns the index of the first mismatch between two arrays.
    static int
    mismatch(short[] a, int fromIndexA, short[] b, int fromIndexB, int len)
    Finds and returns the index of the first mismatch between two short arrays starting from specified indices.
    static int
    mismatch(short[] a, short[] b)
    Finds and returns the index of the first mismatch between two arrays.
    static <T extends Comparable<? super T>>
    int
    mismatch(Iterable<T> a, Iterable<T> b)
    Finds and returns the index of the first mismatch between two iterables.
    static <T> int
    mismatch(Iterable<T> a, Iterable<T> b, Comparator<? super T> cmp)
    Finds and returns the index of the first mismatch between two iterables using the specified comparator.
    static <T> int
    mismatch(Collection<T> a, int fromIndexA, Collection<T> b, int fromIndexB, int len)
    Finds and returns the index of the first mismatch between two collections starting from specified indices.
    static <T> int
    mismatch(Collection<T> a, int fromIndexA, Collection<T> b, int fromIndexB, int len, Comparator<? super T> cmp)
    Finds and returns the index of the first mismatch between two collections starting from specified indices.
    static <T extends Comparable<? super T>>
    int
    mismatch(Iterator<T> a, Iterator<T> b)
    Finds and returns the index of the first mismatch between two iterators.
    static <T> int
    mismatch(Iterator<T> a, Iterator<T> b, Comparator<? super T> cmp)
    Finds and returns the index of the first mismatch between two iterators using the specified comparator.
    static <T extends Comparable<? super T>>
    int
    mismatch(T[] a, int fromIndexA, T[] b, int fromIndexB, int len)
    Finds and returns the index of the first mismatch between two arrays starting from specified indices.
    static <T> int
    mismatch(T[] a, int fromIndexA, T[] b, int fromIndexB, int len, Comparator<? super T> cmp)
    Finds and returns the index of the first mismatch between two arrays starting from specified indices.
    static <T extends Comparable<? super T>>
    int
    mismatch(T[] a, T[] b)
    Finds and returns the index of the first mismatch between two arrays.
    static <T> int
    mismatch(T[] a, T[] b, Comparator<? super T> cmp)
    Finds and returns the index of the first mismatch between two arrays.
    static void
    moveRange(boolean[] a, int fromIndex, int toIndex, int newPositionStartIndex)
    Moves a range of elements in the given array to a new position within the array.
    static void
    moveRange(byte[] a, int fromIndex, int toIndex, int newPositionStartIndex)
    Moves a range of elements in the given array to a new position within the array.
    static void
    moveRange(char[] a, int fromIndex, int toIndex, int newPositionStartIndex)
    Moves a range of elements in the given array to a new position within the array.
    static void
    moveRange(double[] a, int fromIndex, int toIndex, int newPositionStartIndex)
    Moves a range of elements in the given array to a new position within the array.
    static void
    moveRange(float[] a, int fromIndex, int toIndex, int newPositionStartIndex)
    Moves a range of elements in the given array to a new position within the array.
    static void
    moveRange(int[] a, int fromIndex, int toIndex, int newPositionStartIndex)
    Moves a range of elements in the given array to a new position within the array.
    static void
    moveRange(long[] a, int fromIndex, int toIndex, int newPositionStartIndex)
    Moves a range of elements in the given array to a new position within the array.
    static void
    moveRange(short[] a, int fromIndex, int toIndex, int newPositionStartIndex)
    Moves a range of elements in the given array to a new position within the array.
    static String
    moveRange(String str, int fromIndex, int toIndex, int newPositionStartIndex)
    Returns a new string with the specified range moved to the new position.
    static <T> boolean
    moveRange(List<T> c, int fromIndex, int toIndex, int newPositionStartIndex)
    Moves a range of elements in the given list to a new position within the list.
    static <T> void
    moveRange(T[] a, int fromIndex, int toIndex, int newPositionStartIndex)
    Moves a range of elements in the given array to a new position within the array.
    static void
    negate(boolean[] a)
    Negates all elements in the specified boolean array.
    static void
    negate(boolean[] a, int fromIndex, int toIndex)
    Negates all elements in the specified range of the boolean array.
    static Boolean
    Note: copied from Apache commons Lang under Apache license v2.0
    static <T> T
    newArray(Class<?> componentType, int length)
    Creates a new array of the specified component type and length.
    static <T> T
    newArray(Class<?> componentType, int... dimensions)
    Creates a new array of the specified component type and dimensions.
    static <T> ArrayDeque<T>
    Creates a new instance of an ArrayDeque.
    static <T> ArrayDeque<T>
    newArrayDeque(int numElements)
    Creates a new instance of an ArrayDeque with the specified initial capacity.
    static <E> ArrayDeque<E>
    newArrayDeque(Collection<? extends E> c)
    Creates a new instance of an ArrayDeque with the elements from the specified collection.
    static <T> ArrayList<T>
    Creates a new instance of an ArrayList.
    static <T> ArrayList<T>
    newArrayList(int initialCapacity)
    Creates a new instance of an ArrayList with the specified initial capacity.
    static <T> ArrayList<T>
    newArrayList(Collection<? extends T> c)
    Creates a new instance of an ArrayList with the elements from the specified collection.
    static <T> T
    newBean(Class<T> targetType)
    Creates a new instance of the specified bean class.
    static <K, V> BiMap<K,V>
    Creates a new instance of a BiMap.
    static <K, V> BiMap<K,V>
    newBiMap(int initialCapacity)
    Creates a new instance of a BiMap with the specified initial capacity.
    static <K, V> BiMap<K,V>
    newBiMap(int initialCapacity, float loadFactor)
    Creates a new instance of a BiMap with the specified initial capacity and load factor.
    static <K, V> BiMap<K,V>
    newBiMap(Class<? extends Map> keyMapType, Class<? extends Map> valueMapType)
    Creates a new instance of a BiMap with the specified key map type which is used to create map to store key/value pairs and value map type which is used to create map to store value/key pairs.
    static <K, V> BiMap<K,V>
    newBiMap(Supplier<? extends Map<K,V>> keyMapSupplier, Supplier<? extends Map<V,K>> valueMapSupplier)
    Creates a new instance of a BiMap with the specified key map supplier which provides the map to store key/value pairs and value map supplier which provides the map to store value/key pairs.
    static <T> Collection<T>
    newCollection(Class<? extends Collection> targetType)
    Creates a new collection of the specified type.
    static <T> Collection<T>
    newCollection(Class<? extends Collection> targetType, int size)
    Creates a new collection of the specified type with the given initial size.
    static <K, V> ConcurrentHashMap<K,V>
    Creates a new instance of a ConcurrentHashMap.
    static <K, V> ConcurrentHashMap<K,V>
    newConcurrentHashMap(int initialCapacity)
    Creates a new instance of a ConcurrentHashMap with the specified initial capacity.
    static <K, V> ConcurrentHashMap<K,V>
    newConcurrentHashMap(Map<? extends K,? extends V> m)
    Creates a new instance of a ConcurrentHashMap with the entries from the specified map.
    static <T> Set<T>
    Creates a new instance of a concurrent hash set by ConcurrentHashMap.
    static <T> Set<T>
    newConcurrentHashSet(int initialCapacity)
    Creates a new instance of a concurrent hash set with the specified initial capacity.
    static <T> Set<T>
    Creates a new instance of a concurrent hash set with the elements from the specified collection.
    static DataSet
    newDataSet(String keyColumnName, String valueColumnName, Map<?,?> m)
    Creates a new DataSet from the provided Map.
    static DataSet
    newDataSet(String columnName, Collection<?> column)
    Creates a new DataSet with single column from the provided Collection.
    static DataSet
    Creates a new DataSet with the specified rows.
    static DataSet
    newDataSet(Collection<?> rows, Map<String,Object> properties)
    Creates a new DataSet with the specified rows and properties.
    static DataSet
    newDataSet(Collection<String> columnNames, Object[][] rowList)
    Creates a new DataSet with the specified column names and rows.
    static DataSet
    newDataSet(Collection<String> columnNames, Collection<?> rows)
    Creates a new DataSet with the specified column names and rows.
    static DataSet
    newDataSet(Collection<String> columnNames, Collection<?> rows, Map<String,Object> properties)
    Creates a new DataSet with the specified column names, rows, and properties.
    static <C extends Collection<?>>
    DataSet
    Creates a new DataSet from the provided Map.
    static DataSet
    Creates a new empty DataSet.
    static DataSet
    Creates a new empty DataSet with the specified column names.
    static DataSet
    newEmptyDataSet(Collection<String> columnNames, Map<String,Object> properties)
    Creates a new empty DataSet with the specified column names and properties.
    static <K, V> Map.Entry<K,V>
    newEntry(K key, V value)
    Creates a new entry with the specified key and value.
    static <K, V> Map<K,V>
    Creates a new instance of a HashMap.
    static <K, V> Map<K,V>
    newHashMap(int initialCapacity)
    Creates a new instance of a HashMap with the specified initial capacity.
    static <K, V> Map<K,V>
    newHashMap(Collection<? extends V> c, Function<? super V,? extends K> keyExtractor)
    Creates a new instance of a HashMap with the elements from the specified collection.
    static <K, V> Map<K,V>
    newHashMap(Map<? extends K,? extends V> m)
    Creates a new instance of a HashMap with the entries from the specified map.
    static <T> Set<T>
    Creates a new instance of a HashSet.
    static <T> Set<T>
    newHashSet(int initialCapacity)
    Creates a new instance of a HashSet with the specified initial capacity.
    static <T> Set<T>
    newHashSet(Collection<? extends T> c)
    Creates a new instance of a HashSet with the elements from the specified collection.
    static <K, V> IdentityHashMap<K,V>
    Creates a new instance of an IdentityHashMap.
    static <K, V> IdentityHashMap<K,V>
    newIdentityHashMap(int initialCapacity)
    Creates a new instance of an IdentityHashMap with the specified initial capacity.
    static <K, V> IdentityHashMap<K,V>
    newIdentityHashMap(Map<? extends K,? extends V> m)
    Creates a new instance of an IdentityHashMap with the entries from the specified map.
    static <K, V> ImmutableEntry<K,V>
    newImmutableEntry(K key, V value)
    Creates a new immutable entry with the specified key and value.
    static <T> T
    Creates a new instance of the specified class.
    static <K, V> Map<K,V>
    Creates a new instance of a LinkedHashMap.
    static <K, V> Map<K,V>
    newLinkedHashMap(int initialCapacity)
    Creates a new instance of a LinkedHashMap with the specified initial capacity.
    static <K, V> Map<K,V>
    newLinkedHashMap(Collection<? extends V> c, Function<? super V,? extends K> keyExtractor)
    Creates a new instance of a LinkedHashMap with the elements from the specified collection.
    static <K, V> Map<K,V>
    newLinkedHashMap(Map<? extends K,? extends V> m)
    Creates a new instance of a LinkedHashMap with the entries from the specified map.
    static <T> Set<T>
    Creates a new instance of HashSet.
    static <T> Set<T>
    newLinkedHashSet(int initialCapacity)
    Creates a new instance of a LinkedHashSet with the specified initial capacity.
    static <T> Set<T>
    newLinkedHashSet(Collection<? extends T> c)
    Creates a new instance of a LinkedHashSet with the elements from the specified collection.
    static <T> LinkedList<T>
    Creates a new instance of a LinkedList.
    static <T> LinkedList<T>
    newLinkedList(Collection<? extends T> c)
    Creates a new instance of a LinkedList with the elements from the specified collection.
    static <K, E> ListMultimap<K,E>
    Creates a new instance of a ListMultimap backed by a LinkedHashMap.
    static <K, E> ListMultimap<K,E>
    newLinkedListMultimap(int initialCapacity)
    Creates a new instance of a ListMultimap backed by a LinkedHashMap with the specified initial capacity.
    static <K, E> ListMultimap<K,E>
    newLinkedListMultimap(Map<? extends K,? extends E> m)
    Creates a new instance of a ListMultimap backed by a LinkedHashMap with the entries from the specified map.
    static <K, E> SetMultimap<K,E>
    Creates a new instance of a SetMultimap backed by a LinkedHashMap.
    static <K, E> SetMultimap<K,E>
    newLinkedSetMultimap(int initialCapacity)
    Creates a new instance of a SetMultimap backed by a LinkedHashMap with the specified initial capacity.
    static <K, E> SetMultimap<K,E>
    newLinkedSetMultimap(Map<? extends K,? extends E> m)
    Creates a new instance of a SetMultimap backed by a LinkedHashMap with the entries from the specified map.
    static <K, E> ListMultimap<K,E>
    Creates a new instance of a ListMultimap.
    static <K, E> ListMultimap<K,E>
    newListMultimap(int initialCapacity)
    Creates a new instance of a ListMultimap with the specified initial capacity.
    static <K, E> ListMultimap<K,E>
    newListMultimap(Class<? extends Map> mapType)
    Creates a new instance of a ListMultimap with the specified map type which is used to create the backed map for storing entries.
    static <K, E> ListMultimap<K,E>
    newListMultimap(Class<? extends Map> mapType, Class<? extends List> valueType)
    Creates a new instance of a ListMultimap with the specified map type which is used to create the backed map for storing entries and value type which is used to create the backed list for storing values.
    static <T, K> ListMultimap<K,T>
    newListMultimap(Collection<? extends T> c, Function<? super T,? extends K> keyExtractor)
    Creates a new instance of a ListMultimap with the keys extracted from the specified collection by the specified Function and values from the specified collection.
    static <T, K, E> ListMultimap<K,E>
    newListMultimap(Collection<? extends T> c, Function<? super T,? extends K> keyExtractor, Function<? super T,? extends E> valueExtractor)
    Creates a new instance of a ListMultimap with the keys and values extracted from the specified collection.
    static <K, E> ListMultimap<K,E>
    newListMultimap(Supplier<? extends Map<K,List<E>>> mapSupplier, Supplier<? extends List<E>> valueSupplier)
    Creates a new instance of a ListMultimap with the specified map and value suppliers.
    static <K, E> ListMultimap<K,E>
    newListMultimap(Map<? extends K,? extends E> m)
    Creates a new instance of a ListMultimap with the entries from the specified map.
    static <K, V> Map<K,V>
    newMap(Class<? extends Map> targetType)
    Creates a new map of the specified type.
    static <K, V> Map<K,V>
    newMap(Class<? extends Map> targetType, int size)
    Creates a new map of the specified type with the given initial size.
    static <K, E, V extends Collection<E>>
    Multimap<K,E,V>
    newMultimap(Supplier<? extends Map<K,V>> mapSupplier, Supplier<? extends V> valueSupplier)
    Creates a new instance of a Multimap with the specified map which provides the map to store key/value pairs and value supplier which provides the collection to store values.
    static <T> Multiset<T>
    Creates a new instance of a Multiset.
    static <T> Multiset<T>
    newMultiset(int initialCapacity)
    Creates a new instance of a Multiset with the specified initial capacity.
    static <T> Multiset<T>
    newMultiset(Class<? extends Map> valueMapType)
    Creates a new instance of a Multiset with the specified backed Map type for storing element/occurrence pairs.
    static <T> Multiset<T>
    newMultiset(Collection<? extends T> c)
    Creates a new instance of a Multiset with the elements from the specified collection.
    static <T> Multiset<T>
    newMultiset(Supplier<? extends Map<T,?>> mapSupplier)
    Creates a new instance of a Multiset with the specified Supplier which provides the map to store element/occurrence pairs.
    static <T> T
    newProxyInstance(Class<?>[] interfaceClasses, InvocationHandler h)
    Creates a new proxy instance for the specified interfaces using the provided invocation handler.
    static <T> T
    newProxyInstance(Class<T> interfaceClass, InvocationHandler h)
    Creates a new proxy instance for the specified interface using the provided invocation handler.
    static <E> Set<E>
    Returns a set backed by the specified map.
    static <K, E> SetMultimap<K,E>
    Creates a new instance of a SetMultimap.
    static <K, E> SetMultimap<K,E>
    newSetMultimap(int initialCapacity)
    Creates a new instance of a SetMultimap with the specified initial capacity.
    static <K, E> SetMultimap<K,E>
    newSetMultimap(Class<? extends Map> mapType)
    Creates a new instance of a SetMultimap with the specified map type which is used to create the backed map for storing entries.
    static <K, E> SetMultimap<K,E>
    newSetMultimap(Class<? extends Map> mapType, Class<? extends Set> valueType)
    Creates a new instance of a SetMultimap with the specified map type which is used to create the backed map for storing entries and value type which is used to create the backed Set for storing values.
    static <T, K> SetMultimap<K,T>
    newSetMultimap(Collection<? extends T> c, Function<? super T,? extends K> keyExtractor)
    Creates a new instance of a SetMultimap with the keys extracted from the specified collection by the specified Function and values from the specified collection.
    static <T, K, E> SetMultimap<K,E>
    newSetMultimap(Collection<? extends T> c, Function<? super T,? extends K> keyExtractor, Function<? super T,? extends E> valueExtractor)
    Creates a new instance of a SetMultimap with the keys and values extracted from the specified collection.
    static <K, E> SetMultimap<K,E>
    newSetMultimap(Supplier<? extends Map<K,Set<E>>> mapSupplier, Supplier<? extends Set<E>> valueSupplier)
    Creates a new instance of a SetMultimap with the specified map and value suppliers.
    static <K, E> SetMultimap<K,E>
    newSetMultimap(Map<? extends K,? extends E> m)
    Creates a new instance of a SetMultimap with the entries from the specified map.
    static <K extends Comparable<? super K>, E>
    ListMultimap<K,E>
    Creates a new instance of a ListMultimap backed by a SortedMap.
    static <K extends Comparable<? super K>, E>
    ListMultimap<K,E>
    newSortedListMultimap(Map<? extends K,? extends E> m)
    Creates a new instance of a ListMultimap backed by a SortedMap with the entries from the specified map.
    static <K extends Comparable<? super K>, E>
    SetMultimap<K,E>
    Creates a new instance of a SetMultimap backed by a SortedMap.
    static <K extends Comparable<? super K>, E>
    SetMultimap<K,E>
    newSortedSetMultimap(Map<? extends K,? extends E> m)
    Creates a new instance of a SetMultimap backed by a SortedMap with the entries from the specified map.
    static <K extends Comparable<? super K>, V>
    TreeMap<K,V>
    Creates a new instance of a TreeMap.
    static <C, K extends C, V>
    TreeMap<K,V>
    newTreeMap(Comparator<C> comparator)
    Creates a new instance of a TreeMap with the specified comparator.
    static <K extends Comparable<? super K>, V>
    TreeMap<K,V>
    newTreeMap(Map<? extends K,? extends V> m)
    Creates a new instance of a TreeMap with the entries from the specified map.
    static <K, V> TreeMap<K,V>
    newTreeMap(SortedMap<K,? extends V> m)
    Creates a new instance of a TreeMap with the entries from the specified sorted map.
    static <T extends Comparable<? super T>>
    TreeSet<T>
    Creates a new instance of TreeSet.
    static <T extends Comparable<? super T>>
    TreeSet<T>
    newTreeSet(Collection<? extends T> c)
    Creates a new instance of a TreeSet with the elements from the specified collection.
    static <T> TreeSet<T>
    newTreeSet(Comparator<? super T> comparator)
    Creates a new instance of a TreeSet with the specified comparator.
    static <T> TreeSet<T>
    Creates a new instance of a TreeSet with the elements from the specified sorted set.
    static <T> boolean
    nMatch(Iterable<? extends T> c, int atLeast, int atMost, Predicate<? super T> filter)
    Checks if the number of elements in the input iterable that match the given predicate is between the specified minimum and maximum values (inclusive).
    static <T> boolean
    nMatch(Iterator<? extends T> iter, int atLeast, int atMost, Predicate<? super T> filter)
    Checks if the number of elements in the input iterator that match the given predicate is between the specified minimum and maximum values (inclusive).
    static <T> boolean
    nMatch(T[] a, int atLeast, int atMost, Predicate<? super T> filter)
    Checks if the number of elements in the input array that match the given predicate is between the specified minimum and maximum values (inclusive).
    static <T> boolean
    noneMatch(Iterable<? extends T> c, Predicate<? super T> filter)
    Checks if none of the elements in the input iterable match the given predicate.
    static <T> boolean
    noneMatch(Iterator<? extends T> iter, Predicate<? super T> filter)
    Checks if none of the elements in the input iterator match the given predicate.
    static <T> boolean
    noneMatch(T[] a, Predicate<? super T> filter)
    Checks if none of the elements in the input array match the given predicate.
    static boolean
    Checks if the specified CharSequence is not null and not empty and not contains only whitespace characters.
    static boolean
    notEmpty(boolean[] a)
    Checks if the specified boolean array is not null and not empty.
    static boolean
    notEmpty(byte[] a)
    Checks if the specified byte array is not null and not empty.
    static boolean
    notEmpty(char[] a)
    Checks if the specified char array is not null and not empty.
    static boolean
    notEmpty(double[] a)
    Checks if the specified double array is not null and not empty.
    static boolean
    notEmpty(float[] a)
    Checks if the specified float array is not null and not empty.
    static boolean
    notEmpty(int[] a)
    Checks if the specified int array is not null and not empty.
    static boolean
    notEmpty(long[] a)
    Checks if the specified long array is not null and not empty.
    static boolean
    notEmpty(short[] a)
    Checks if the specified short array is not null and not empty.
    static boolean
    Checks if the specified DataSet is not null and not empty.
    static boolean
    notEmpty(Multimap<?,?,?> m)
    Checks if the specified Multimap is not null and not empty.
    static boolean
    Checks if the specified Multiset is not null and not empty.
    static boolean
    Checks if the specified PrimitiveList is not null and not empty.
    static boolean
    Checks if the specified CharSequence is not null and not empty.
    static boolean
    notEmpty(Iterable<?> iter)
    Checks if the specified iterable is not null and not empty.
    static boolean
    Checks if the specified object array is not null and not empty.
    static boolean
    Checks if the specified Collection is not null and not empty.
    static boolean
    notEmpty(Iterator<?> iter)
    Checks if the specified iterator is not null and not empty.
    static boolean
    notEmpty(Map<?,?> m)
    Checks if the specified Map is not null and not empty.
    static boolean[]
    nullToEmpty(boolean[] a)
    Returns an empty boolean array if the specified array is null, otherwise returns the original array.
    static byte[]
    nullToEmpty(byte[] a)
    Returns an empty byte array if the specified array is null, otherwise returns the original array.
    static char[]
    nullToEmpty(char[] a)
    Returns an empty char array if the specified array is null, otherwise returns the original array.
    static double[]
    nullToEmpty(double[] a)
    Returns an empty double array if the specified array is null, otherwise returns the original array.
    static float[]
    nullToEmpty(float[] a)
    Returns an empty float array if the specified array is null, otherwise returns the original array.
    static int[]
    nullToEmpty(int[] a)
    Returns an empty int array if the specified array is null, otherwise returns the original array.
    static long[]
    nullToEmpty(long[] a)
    Returns an empty long array if the specified array is null, otherwise returns the original array.
    static short[]
    nullToEmpty(short[] a)
    Returns an empty short array if the specified array is null, otherwise returns the original array.
    static <K, V> ImmutableBiMap<K,V>
    Returns an immutable/unmodifiable empty bi-map if the specified ImmutableBiMap is null, otherwise returns the original bi-map.
    static <T> ImmutableCollection<T>
    Returns an immutable/unmodifiable empty Collection if the specified ImmutableCollection is null, otherwise itself is returned.
    static <T> ImmutableList<T>
    Returns an immutable/unmodifiable empty list if the specified ImmutableList is null, otherwise returns the original list.
    static <K, V> ImmutableMap<K,V>
    Returns an immutable/unmodifiable empty map if the specified ImmutableMap is null, otherwise returns the original map.
    static <K, V> ImmutableNavigableMap<K,V>
    Returns an immutable/unmodifiable empty navigable map if the specified ImmutableNavigableMap is null, otherwise returns the original map.
    static <T> ImmutableNavigableSet<T>
    Returns an immutable/unmodifiable empty navigable set if the specified ImmutableNavigableSet is null, otherwise returns the original set.
    static <T> ImmutableSet<T>
    Returns an immutable/unmodifiable empty set if the specified ImmutableSet is null, otherwise returns the original set.
    static <K, V> ImmutableSortedMap<K,V>
    Returns an immutable/unmodifiable empty sorted map if the specified ImmutableSortedMap is null, otherwise returns the original map.
    static <T> ImmutableSortedSet<T>
    Returns an immutable/unmodifiable empty sorted set if the specified ImmutableSortedSet is null, otherwise returns the original set.
    static Object[]
    Returns an empty Object array if the specified array is null, otherwise returns the original array.
    static String
    Converts a null string to an empty string.
    static String[]
    Returns an empty String array if the specified array is null, otherwise returns the original array.
    static BigDecimal[]
    Returns an empty BigDecimal array if the specified array is null, otherwise returns the original array.
    static BigInteger[]
    Returns an empty BigInteger array if the specified array is null, otherwise returns the original array.
    static Date[]
    Returns an empty Date array if the specified array is null, otherwise returns the original array.
    static Time[]
    Returns an empty Time array if the specified array is null, otherwise returns the original array.
    static Timestamp[]
    Returns an empty Timestamp array if the specified array is null, otherwise returns the original array.
    static Calendar[]
    Returns an empty Calendar array if the specified array is null, otherwise returns the original array.
    static <T> Collection<T>
    Returns an immutable/unmodifiable empty List if the specified list is null, otherwise itself is returned.
    static Date[]
    Returns an empty Date array if the specified array is null, otherwise returns the original array.
    static <T> Iterator<T>
    Returns an immutable/unmodifiable empty iterator if the specified Iterator is null, otherwise itself is returned.
    static <T> List<T>
    nullToEmpty(List<T> list)
    Returns an immutable/unmodifiable empty list if the specified list is null, otherwise itself is returned.
    static <T> ListIterator<T>
    Returns an immutable/unmodifiable empty ListIterator if the specified ListIterator is null, otherwise itself is returned.
    static <K, V> Map<K,V>
    nullToEmpty(Map<K,V> map)
    Returns an immutable/unmodifiable empty map if the specified Map is null, otherwise itself is returned.
    static <K, V> NavigableMap<K,V>
    Returns an immutable/unmodifiable empty NavigableMap if the specified NavigableMap is null, otherwise itself is returned.
    static <T> NavigableSet<T>
    Returns an immutable/unmodifiable empty NavigableSet if the specified NavigableSet is null, otherwise itself is returned.
    static <T> Set<T>
    nullToEmpty(Set<T> set)
    Returns an immutable/unmodifiable empty set if the specified Set is null, otherwise itself is returned.
    static <K, V> SortedMap<K,V>
    Returns an immutable/unmodifiable empty SortedMap if the specified SortedMap is null, otherwise itself is returned.
    static <T> SortedSet<T>
    Returns an immutable/unmodifiable empty SortedSet if the specified SortedSet is null, otherwise itself is returned.
    static <T> T[]
    nullToEmpty(T[] a, Class<T[]> arrayType)
    Returns an empty array of the specified type if the given array is null, otherwise returns the original array.
    static String[]
    Converts the specified String array to an empty String[0] if it's null and each null element String to empty String "".
    static <T> Map<T,Integer>
    occurrencesMap(Iterable<? extends T> c)
    Returns a map with the occurrences of each element in the given iterable collection.
    static <T> Map<T,Integer>
    occurrencesMap(Iterable<? extends T> c, Supplier<Map<T,Integer>> mapSupplier)
    Returns a map with the occurrences of each element in the given iterable collection.
    static <T> Map<T,Integer>
    occurrencesMap(Iterator<? extends T> iter)
    Returns a map with the occurrences of each element in the given iterator.
    static <T> Map<T,Integer>
    occurrencesMap(Iterator<? extends T> iter, Supplier<Map<T,Integer>> mapSupplier)
    Returns a map with the occurrences of each element in the given iterator.
    static <T> Map<T,Integer>
    Returns a map with the occurrences of each element in the given array.
    static <T> Map<T,Integer>
    occurrencesMap(T[] a, Supplier<Map<T,Integer>> mapSupplier)
    Returns a map with the occurrences of each element in the given array.
    static int
    occurrencesOf(boolean[] a, boolean valueToFind)
    Counts the occurrences of a specific boolean value in a boolean array.
    static int
    occurrencesOf(byte[] a, byte valueToFind)
    Counts the occurrences of a specific byte value in a byte array.
    static int
    occurrencesOf(char[] a, char valueToFind)
    Counts the occurrences of a specific char value in a char array.
    static int
    occurrencesOf(double[] a, double valueToFind)
    Counts the occurrences of a specific double value in a double array.
    static int
    occurrencesOf(float[] a, float valueToFind)
    Counts the occurrences of a specific float value in a float array.
    static int
    occurrencesOf(int[] a, int valueToFind)
    Counts the occurrences of a specific int value in a int array.
    static int
    occurrencesOf(long[] a, long valueToFind)
    Counts the occurrences of a specific long value in a long array.
    static int
    occurrencesOf(short[] a, short valueToFind)
    Counts the occurrences of a specific short value in a short array.
    static int
    occurrencesOf(Iterable<?> c, Object valueToFind)
    Counts the occurrences of a specific Object value in an Iterable.
    static int
    occurrencesOf(Object[] a, Object valueToFind)
    Counts the occurrences of a specific Object value in an Object array.
    static int
    occurrencesOf(String str, char valueToFind)
    Counts the occurrences of a specific character in a String.
    static int
    occurrencesOf(String str, String valueToFind)
    Counts the occurrences of a specific String value in another String.
    static int
    occurrencesOf(Iterator<?> iter, Object valueToFind)
    Counts the occurrences of a specific Object value in an Iterator.
    static <T> boolean
    padLeft(List<T> list, int minSize, T objToAdd)
    Appends the provided object to the beginning of the list till the list has at least the specified minimum size.
    static <T> boolean
    padRight(Collection<T> c, int minSize, T objToAdd)
    Appends the provided object to the end of the collection until the collection has at least the specified minimum size.
    static void
    parallelSort(byte[] a)
    Sorts the specified array into ascending numerical order by multiple threads.
    static void
    parallelSort(byte[] a, int fromIndex, int toIndex)
    Sorts the specified range of the array into ascending numerical order by multiple threads.
    static void
    parallelSort(char[] a)
    Sorts the specified array into ascending numerical order by multiple threads.
    static void
    parallelSort(char[] a, int fromIndex, int toIndex)
    Sorts the specified range of the array into ascending numerical order by multiple threads.
    static void
    parallelSort(double[] a)
    Sorts the specified array into ascending numerical order by multiple threads.
    static void
    parallelSort(double[] a, int fromIndex, int toIndex)
    Sorts the specified range of the array into ascending numerical order by multiple threads.
    static void
    parallelSort(float[] a)
    Sorts the specified array into ascending numerical order by multiple threads.
    static void
    parallelSort(float[] a, int fromIndex, int toIndex)
    Sorts the specified range of the array into ascending numerical order by multiple threads.
    static void
    parallelSort(int[] a)
    Sorts the specified array into ascending numerical order by multiple threads.
    static void
    parallelSort(int[] a, int fromIndex, int toIndex)
    Sorts the specified range of the array into ascending numerical order by multiple threads.
    static void
    parallelSort(long[] a)
    Sorts the specified array into ascending numerical order by multiple threads.
    static void
    parallelSort(long[] a, int fromIndex, int toIndex)
    Sorts the specified range of the array into ascending numerical order by multiple threads.
    static void
    parallelSort(short[] a)
    Sorts the specified array into ascending numerical order by multiple threads.
    static void
    parallelSort(short[] a, int fromIndex, int toIndex)
    Sorts the specified range of the array into ascending numerical order by multiple threads.
    static <T extends Comparable<? super T>>
    void
    parallelSort(List<? extends T> list)
    Sorts the specified list according to the natural ordering (where null is minimum) by multiple threads.
    static <T extends Comparable<? super T>>
    void
    parallelSort(List<? extends T> list, int fromIndex, int toIndex)
    Sorts the specified range of the specified list according to the natural ordering (where null is minimum) by multiple threads.
    static <T> void
    parallelSort(List<? extends T> list, int fromIndex, int toIndex, Comparator<? super T> cmp)
    Sorts the specified range of the list according to the order induced by the specified comparator by multiple threads.
    static <T> void
    parallelSort(List<? extends T> list, Comparator<? super T> cmp)
    Sorts the specified list according to the order induced by the specified comparator by multiple threads.
    static <T extends Comparable<? super T>>
    void
    parallelSort(T[] a)
    Sorts the specified array according to the natural ordering (where null is minimum) by multiple threads.
    static <T extends Comparable<? super T>>
    void
    parallelSort(T[] a, int fromIndex, int toIndex)
    Sorts the specified range of the specified array according to the natural ordering (where null is minimum) by multiple threads.
    static <T> void
    parallelSort(T[] a, int fromIndex, int toIndex, Comparator<? super T> cmp)
    Sorts the specified range of the specified array according to the order induced by the specified comparator by multiple threads.
    static <T> void
    parallelSort(T[] a, Comparator<? super T> cmp)
    Sorts the specified array according to the order induced by the specified comparator by multiple threads.
    static <T, U extends Comparable<? super U>>
    void
    parallelSortBy(List<? extends T> list, Function<? super T,? extends U> keyExtractor)
    Sorts the specified list based on the keys extracted by the provided Function by multiple threads.
    static <T, U extends Comparable<? super U>>
    void
    parallelSortBy(T[] a, Function<? super T,? extends U> keyExtractor)
    Sorts the specified array based on the keys extracted by the provided Function by multiple threads.
    static <T> void
    parallelSortByDouble(List<? extends T> list, ToDoubleFunction<? super T> keyExtractor)
    Sorts the specified list based on the double values extracted by the provided ToDoubleFunction by multiple threads.
    static <T> void
    parallelSortByDouble(T[] a, ToDoubleFunction<? super T> keyExtractor)
    Sorts the specified array based on the double values extracted by the provided ToDoubleFunction by multiple threads.
    static <T> void
    parallelSortByFloat(List<? extends T> list, ToFloatFunction<? super T> keyExtractor)
    Sorts the specified list based on the float values extracted by the provided ToFloatFunction by multiple threads.
    static <T> void
    parallelSortByFloat(T[] a, ToFloatFunction<? super T> keyExtractor)
    Sorts the specified array based on the float values extracted by the provided ToFloatFunction by multiple threads.
    static <T> void
    parallelSortByInt(List<? extends T> list, ToIntFunction<? super T> keyExtractor)
    Sorts the specified list based on the int values extracted by the provided ToIntFunction by multiple threads.
    static <T> void
    parallelSortByInt(T[] a, ToIntFunction<? super T> keyExtractor)
    Sorts the specified array based on the int values extracted by the provided ToIntFunction by multiple threads.
    static <T> void
    parallelSortByLong(List<? extends T> list, ToLongFunction<? super T> keyExtractor)
    Sorts the specified list based on the long values extracted by the provided ToLongFunction by multiple threads.
    static <T> void
    parallelSortByLong(T[] a, ToLongFunction<? super T> keyExtractor)
    Sorts the specified array based on the long values extracted by the provided ToLongFunction by multiple threads.
    percentiles(byte[] sortedArray)
    Calculates the percentiles of the provided sorted array of bytes.
    percentiles(char[] sortedArray)
    Calculates the percentiles of the provided sorted array of characters.
    percentiles(double[] sortedArray)
    Calculates the percentiles of the provided sorted array of doubles.
    percentiles(float[] sortedArray)
    Calculates the percentiles of the provided sorted array of floats.
    percentiles(int[] sortedArray)
    Calculates the percentiles of the provided sorted array of integers.
    percentiles(long[] sortedArray)
    Calculates the percentiles of the provided sorted array of longs.
    percentiles(short[] sortedArray)
    Calculates the percentiles of the provided sorted array of shorts.
    static <T> Map<Percentage,T>
    percentiles(List<T> sortedList)
    Calculates the percentiles of the provided sorted list.
    static <T> Map<Percentage,T>
    percentiles(T[] sortedArray)
    Calculates the percentiles of the provided sorted array.
    static <T> T
    println(T obj)
    Prints the given object's string representation to the standard output stream (System.out) and returns the object.
    static boolean
    registerConverter(Class<?> srcClass, BiFunction<?,Class<?>,?> converter)
    Registers a converter for a specific source class.
    static boolean[]
    remove(boolean[] a, boolean valueToRemove)
    Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
    static byte[]
    remove(byte[] a, byte valueToRemove)
    Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
    static char[]
    remove(char[] a, char valueToRemove)
    Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
    static double[]
    remove(double[] a, double valueToRemove)
    Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
    static float[]
    remove(float[] a, float valueToRemove)
    Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
    static int[]
    remove(int[] a, int valueToRemove)
    Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
    static long[]
    remove(long[] a, long valueToRemove)
    Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
    static short[]
    remove(short[] a, short valueToRemove)
    Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
    static String[]
    remove(String[] a, String valueToRemove)
    Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
    static <T> boolean
    remove(Collection<T> c, T valueToRemove)
    Removes the first occurrence of the specified value from the given collection.
    static <T> T[]
    remove(T[] a, T valueToRemove)
    Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
    static boolean[]
    removeAll(boolean[] a, boolean... valuesToRemove)
    Returns a new array with elements copied from the specified array except all occurrences of the specified values.
    static byte[]
    removeAll(byte[] a, byte... valuesToRemove)
    Returns a new array with elements copied from the specified array except all occurrences of the specified values.
    static char[]
    removeAll(char[] a, char... valuesToRemove)
    Returns a new array with elements copied from the specified array except all occurrences of the specified values.
    static double[]
    removeAll(double[] a, double... valuesToRemove)
    Returns a new array with elements copied from the specified array except all occurrences of the specified values.
    static float[]
    removeAll(float[] a, float... valuesToRemove)
    Returns a new array with elements copied from the specified array except all occurrences of the specified values.
    static int[]
    removeAll(int[] a, int... valuesToRemove)
    Returns a new array with elements copied from the specified array except all occurrences of the specified values.
    static long[]
    removeAll(long[] a, long... valuesToRemove)
    Returns a new array with elements copied from the specified array except all occurrences of the specified values.
    static short[]
    removeAll(short[] a, short... valuesToRemove)
    Returns a new array with elements copied from the specified array except all occurrences of the specified values.
    static String[]
    removeAll(String[] a, String... valuesToRemove)
    Returns a new array with elements copied from the specified array except all occurrences of the specified values.
    static <T> boolean
    removeAll(Collection<T> c, Iterable<?> valuesToRemove)
    Removes all occurrences of the specified values from the given collection.
    static <T> boolean
    removeAll(Collection<T> c, Iterator<?> valuesToRemove)
    Removes all occurrences of the specified values from the given collection.
    static <T> boolean
    removeAll(Collection<T> c, T... valuesToRemove)
    Removes all occurrences of the specified values from the given collection.
    static <T> T[]
    removeAll(T[] a, T... valuesToRemove)
    Returns a new array with elements copied from the specified array except all occurrences of the specified values.
    static boolean[]
    removeAllOccurrences(boolean[] a, boolean valueToRemove)
    Returns a new array with elements copied from the specified array except all occurrence of the specified value.
    static byte[]
    removeAllOccurrences(byte[] a, byte valueToRemove)
    Returns a new array with elements copied from the specified array except all occurrence of the specified value.
    static char[]
    removeAllOccurrences(char[] a, char valueToRemove)
    Returns a new array with elements copied from the specified array except all occurrence of the specified value.
    static double[]
    removeAllOccurrences(double[] a, double valueToRemove)
    Returns a new array with elements copied from the specified array except all occurrence of the specified value.
    static float[]
    removeAllOccurrences(float[] a, float valueToRemove)
    Returns a new array with elements copied from the specified array except all occurrence of the specified value.
    static int[]
    removeAllOccurrences(int[] a, int valueToRemove)
    Returns a new array with elements copied from the specified array except all occurrence of the specified value.
    static long[]
    removeAllOccurrences(long[] a, long valueToRemove)
    Returns a new array with elements copied from the specified array except all occurrence of the specified value.
    static short[]
    removeAllOccurrences(short[] a, short valueToRemove)
    Returns a new array with elements copied from the specified array except all occurrence of the specified value.
    static String[]
    removeAllOccurrences(String[] a, String valueToRemove)
    Returns a new array with elements copied from the specified array except all occurrence of the specified value.
    static <T> boolean
    removeAllOccurrences(Collection<T> c, T valueToRemove)
    Removes all occurrences of the specified value from the given collection.
    static <T> T[]
    removeAllOccurrences(T[] a, T valueToRemove)
    Returns a new array with elements copied from the specified array except all occurrence of the specified value.
    static boolean[]
    removeDuplicates(boolean[] a)
    Deprecated.
    Use distinct(boolean[]) instead.
    static byte[]
    removeDuplicates(byte[] a)
    Deprecated.
    Use distinct(byte[]) instead.
    static byte[]
    removeDuplicates(byte[] a, boolean isSorted)
    Returns a new array with elements from the input array but without any duplicates.
    static byte[]
    removeDuplicates(byte[] a, int fromIndex, int toIndex, boolean isSorted)
    Returns a new array with distinct elements within the specified range.
    static char[]
    removeDuplicates(char[] a)
    Deprecated.
    Use distinct(char[]) instead.
    static char[]
    removeDuplicates(char[] a, boolean isSorted)
    Returns a new array with elements from the input array but without any duplicates.
    static char[]
    removeDuplicates(char[] a, int fromIndex, int toIndex, boolean isSorted)
    Returns a new array with distinct elements within the specified range.
    static double[]
    removeDuplicates(double[] a)
    Deprecated.
    Use distinct(double[]) instead.
    static double[]
    removeDuplicates(double[] a, boolean isSorted)
    Returns a new array with elements from the input array but without any duplicates.
    static double[]
    removeDuplicates(double[] a, int fromIndex, int toIndex, boolean isSorted)
    Returns a new array with distinct elements within the specified range.
    static float[]
    removeDuplicates(float[] a)
    Deprecated.
    Use distinct(float[]) instead.
    static float[]
    removeDuplicates(float[] a, boolean isSorted)
    Returns a new array with elements from the input array but without any duplicates.
    static float[]
    removeDuplicates(float[] a, int fromIndex, int toIndex, boolean isSorted)
    Returns a new array with distinct elements within the specified range.
    static int[]
    Deprecated.
    Use distinct(int[]) instead.
    static int[]
    removeDuplicates(int[] a, boolean isSorted)
    Returns a new array with elements from the input array but without any duplicates.
    static int[]
    removeDuplicates(int[] a, int fromIndex, int toIndex, boolean isSorted)
    Returns a new array with distinct elements within the specified range.
    static long[]
    removeDuplicates(long[] a)
    Deprecated.
    Use distinct(long[]) instead.
    static long[]
    removeDuplicates(long[] a, boolean isSorted)
    Returns a new array with elements from the input array but without any duplicates.
    static long[]
    removeDuplicates(long[] a, int fromIndex, int toIndex, boolean isSorted)
    Returns a new array with distinct elements within the specified range.
    static short[]
    removeDuplicates(short[] a)
    Deprecated.
    Use distinct(short[]) instead.
    static short[]
    removeDuplicates(short[] a, boolean isSorted)
    Returns a new array with elements from the input array but without any duplicates.
    static short[]
    removeDuplicates(short[] a, int fromIndex, int toIndex, boolean isSorted)
    Returns a new array with distinct elements within the specified range.
    static String[]
    Returns a new array with elements from the input array but without any duplicates.
    static String[]
    removeDuplicates(String[] a, boolean isSorted)
    Returns a new array with elements from the input array but without any duplicates.
    static String[]
    removeDuplicates(String[] a, int fromIndex, int toIndex, boolean isSorted)
    Returns a new array with distinct elements within the specified range.
    static boolean
    Removes duplicate elements from the given collection.
    static boolean
    removeDuplicates(Collection<?> c, boolean isSorted)
    Removes duplicate elements from the given collection.
    static <T> T[]
    Returns a new array with elements from the input array but without any duplicates.
    static <T> T[]
    removeDuplicates(T[] a, boolean isSorted)
    Returns a new array with elements from the input array but without any duplicates.
    static <T> T[]
    removeDuplicates(T[] a, int fromIndex, int toIndex, boolean isSorted)
    Returns a new array with distinct elements within the specified range.
    static <T> List<T>
    repeat(T value, int n)
    Repeats the provided value a specified number of times.
    static <T> List<T>
    Repeats the entire specified Collection n times.
    static <T> List<T>
    repeatCollectionToSize(Collection<? extends T> c, int size)
    Repeats the entire specified Collection n times till reach the specified size.
    static <T> List<T>
    repeatElements(Collection<? extends T> c, int n)
    Repeats each element in the specified Collection n times one by one.
    static <T> List<T>
    Repeats each element in the specified Collection n times one by one till reach the specified size.
    static int
    replaceAll(boolean[] a, boolean oldVal, boolean newVal)
    Replaces all occurrences of the specified old value with the new value in the given boolean array.
    static void
    replaceAll(boolean[] a, BooleanUnaryOperator operator)
    Replaces all elements in the given boolean array using the specified BooleanUnaryOperator.
    static int
    replaceAll(byte[] a, byte oldVal, byte newVal)
    Replaces all occurrences of the specified old value with the new value in the given byte array.
    static void
    replaceAll(byte[] a, ByteUnaryOperator operator)
    Replaces all elements in the given byte array using the specified ByteUnaryOperator.
    static int
    replaceAll(char[] a, char oldVal, char newVal)
    Replaces all occurrences of the specified old value with the new value in the given char array.
    static void
    replaceAll(char[] a, CharUnaryOperator operator)
    Replaces all elements in the given char array using the specified CharUnaryOperator.
    static int
    replaceAll(double[] a, double oldVal, double newVal)
    Replaces all occurrences of the specified old value with the new value in the given double array.
    static void
    replaceAll(double[] a, DoubleUnaryOperator operator)
    Replaces all elements in the given double array using the specified DoubleUnaryOperator.
    static int
    replaceAll(float[] a, float oldVal, float newVal)
    Replaces all occurrences of the specified old value with the new value in the given float array.
    static void
    replaceAll(float[] a, FloatUnaryOperator operator)
    Replaces all elements in the given float array using the specified FloatUnaryOperator.
    static int
    replaceAll(int[] a, int oldVal, int newVal)
    Replaces all occurrences of the specified old value with the new value in the given int array.
    static void
    replaceAll(int[] a, IntUnaryOperator operator)
    Replaces all elements in the given int array using the specified IntUnaryOperator.
    static int
    replaceAll(long[] a, long oldVal, long newVal)
    Replaces all occurrences of the specified old value with the new value in the given long array.
    static void
    replaceAll(long[] a, LongUnaryOperator operator)
    Replaces all elements in the given long array using the specified LongUnaryOperator.
    static int
    replaceAll(short[] a, short oldVal, short newVal)
    Replaces all occurrences of the specified old value with the new value in the given short array.
    static void
    replaceAll(short[] a, ShortUnaryOperator operator)
    Replaces all elements in the given short array using the specified ShortUnaryOperator.
    static <T> int
    replaceAll(List<T> list, Object oldVal, T newVal)
    Replaces all occurrences of the specified old value with the new value in the given list.
    static <T> void
    replaceAll(List<T> list, UnaryOperator<T> operator)
    Replaces all elements in the given list using the specified UnaryOperator.
    static <T> int
    replaceAll(T[] a, Object oldVal, T newVal)
    Replaces all occurrences of the specified old value with the new value in the given array.
    static <T> void
    replaceAll(T[] a, UnaryOperator<T> operator)
    Replaces all elements in the given array using the specified UnaryOperator.
    static int
    replaceIf(boolean[] a, BooleanPredicate predicate, boolean newValue)
    Replaces all elements in the given boolean array that satisfy the provided predicate with a specified boolean value.
    static int
    replaceIf(byte[] a, BytePredicate predicate, byte newValue)
    Replaces all elements in the given byte array that satisfy the provided predicate with a specified byte value.
    static int
    replaceIf(char[] a, CharPredicate predicate, char newValue)
    Replaces all elements in the given char array that satisfy the provided predicate with a specified char value.
    static int
    replaceIf(double[] a, DoublePredicate predicate, double newValue)
    Replaces all elements in the given double array that satisfy the provided predicate with a specified double value.
    static int
    replaceIf(float[] a, FloatPredicate predicate, float newValue)
    Replaces all elements in the given float array that satisfy the provided predicate with a specified float value.
    static int
    replaceIf(int[] a, IntPredicate predicate, int newValue)
    Replaces all elements in the given int array that satisfy the provided predicate with a specified int value.
    static int
    replaceIf(long[] a, LongPredicate predicate, long newValue)
    Replaces all elements in the given long array that satisfy the provided predicate with a specified long value.
    static int
    replaceIf(short[] a, ShortPredicate predicate, short newValue)
    Replaces all elements in the given short array that satisfy the provided predicate with a specified short value.
    static <T> int
    replaceIf(List<T> list, Predicate<? super T> predicate, T newValue)
    Replaces all elements in the given list that satisfy the provided predicate with a specified value.
    static <T> int
    replaceIf(T[] a, Predicate<? super T> predicate, T newValue)
    Replaces all elements in the given array that satisfy the provided predicate with a specified value.
    static boolean[]
    replaceRange(boolean[] a, int fromIndex, int toIndex, boolean[] replacement)
    Returns a new array with the specified range replaced with the replacement array.
    static byte[]
    replaceRange(byte[] a, int fromIndex, int toIndex, byte[] replacement)
    Returns a new array with the specified range replaced with the replacement array.
    static char[]
    replaceRange(char[] a, int fromIndex, int toIndex, char[] replacement)
    Returns a new array with the specified range replaced with the replacement array.
    static double[]
    replaceRange(double[] a, int fromIndex, int toIndex, double[] replacement)
    Returns a new array with the specified range replaced with the replacement array.
    static float[]
    replaceRange(float[] a, int fromIndex, int toIndex, float[] replacement)
    Returns a new array with the specified range replaced with the replacement array.
    static int[]
    replaceRange(int[] a, int fromIndex, int toIndex, int[] replacement)
    Returns a new array with the specified range replaced with the replacement array.
    static long[]
    replaceRange(long[] a, int fromIndex, int toIndex, long[] replacement)
    Returns a new array with the specified range replaced with the replacement array.
    static short[]
    replaceRange(short[] a, int fromIndex, int toIndex, short[] replacement)
    Returns a new array with the specified range replaced with the replacement array.
    static String[]
    replaceRange(String[] a, int fromIndex, int toIndex, String[] replacement)
    Returns a new array with the specified range replaced with the replacement array.
    static String
    replaceRange(String str, int fromIndex, int toIndex, String replacement)
    Returns a new String with the specified range replaced with the replacement String.
    static <T> boolean
    replaceRange(List<T> c, int fromIndex, int toIndex, Collection<? extends T> replacement)
    Replaces a range of elements in the given list with the elements from the replacement collection.
    static <T> T[]
    replaceRange(T[] a, int fromIndex, int toIndex, T[] replacement)
    Returns a new array with the specified range replaced with the replacement array.
    static <T> T
    Checks if the specified object reference is not null, and throws NullPointerException if it is.
    static <T> T
    requireNonNull(T obj, String errorMessage)
    Checks if the specified object reference is not null, and throws NullPointerException if it is.
    static <T> T
    requireNonNull(T obj, Supplier<String> errorMessageSupplier)
    Checks if the specified object reference is not null, and throws NullPointerException if it is.
    static <T> boolean
    retainAll(Collection<T> c, Collection<? extends T> objsToKeep)
    Retains only the elements in the specified collection that are present in the specified collection of elements to keep.
    static void
    reverse(boolean[] a)
    Reverses the order of the elements in the specified boolean array.
    static void
    reverse(boolean[] a, int fromIndex, int toIndex)
    Reverses the order of the elements in the specified range of the specified boolean array.
    static void
    reverse(byte[] a)
    Reverses the order of the elements in the specified byte array.
    static void
    reverse(byte[] a, int fromIndex, int toIndex)
    Reverses the order of the elements in the specified range of the specified byte array.
    static void
    reverse(char[] a)
    Reverses the order of the elements in the specified char array.
    static void
    reverse(char[] a, int fromIndex, int toIndex)
    Reverses the order of the elements in the specified range of the specified char array.
    static void
    reverse(double[] a)
    Reverses the order of the elements in the specified double array.
    static void
    reverse(double[] a, int fromIndex, int toIndex)
    Reverses the order of the elements in the specified range of the specified double array.
    static void
    reverse(float[] a)
    Reverses the order of the elements in the specified float array.
    static void
    reverse(float[] a, int fromIndex, int toIndex)
    Reverses the order of the elements in the specified range of the specified float array.
    static void
    reverse(int[] a)
    Reverses the order of the elements in the specified int array.
    static void
    reverse(int[] a, int fromIndex, int toIndex)
    Reverses the order of the elements in the specified range of the specified int array.
    static void
    reverse(long[] a)
    Reverses the order of the elements in the specified long array.
    static void
    reverse(long[] a, int fromIndex, int toIndex)
    Reverses the order of the elements in the specified range of the specified long array.
    static void
    reverse(short[] a)
    Reverses the order of the elements in the specified short array.
    static void
    reverse(short[] a, int fromIndex, int toIndex)
    Reverses the order of the elements in the specified range of the specified short array.
    static void
    Reverses the order of the elements in the specified object array.
    static void
    reverse(Object[] a, int fromIndex, int toIndex)
    Reverses the order of the elements in the specified range of the specified object array.
    static void
    Reverses the order of the elements in the specified collection that has a well-defined encounter order.
    static void
    reverse(List<?> list)
    Reverses the order of the elements in the specified list.
    static void
    reverse(List<?> list, int fromIndex, int toIndex)
    Reverses the order of the elements in the specified range of the specified list.
    static void
    reverseSort(boolean[] a)
    Sorts the specified array of booleans in reverse order.
    static void
    reverseSort(boolean[] a, int fromIndex, int toIndex)
    Sorts the specified range of the array of booleans in reverse order.
    static void
    reverseSort(byte[] a)
    Sorts the specified array of bytes in reverse order.
    static void
    reverseSort(byte[] a, int fromIndex, int toIndex)
    Sorts the specified range of the array of bytes in reverse order.
    static void
    reverseSort(char[] a)
    Sorts the specified array of characters in reverse order.
    static void
    reverseSort(char[] a, int fromIndex, int toIndex)
    Sorts the specified range of the array of characters in reverse order.
    static void
    reverseSort(double[] a)
    Sorts the specified array of doubles in reverse order.
    static void
    reverseSort(double[] a, int fromIndex, int toIndex)
    Sorts the specified range of the array of doubles in reverse order.
    static void
    reverseSort(float[] a)
    Sorts the specified array of floats in reverse order.
    static void
    reverseSort(float[] a, int fromIndex, int toIndex)
    Sorts the specified range of the array of floats in reverse order.
    static void
    reverseSort(int[] a)
    Sorts the specified array of ints in reverse order.
    static void
    reverseSort(int[] a, int fromIndex, int toIndex)
    Sorts the specified range of the array of ints in reverse order.
    static void
    reverseSort(long[] a)
    Sorts the specified array of longs in reverse order.
    static void
    reverseSort(long[] a, int fromIndex, int toIndex)
    Sorts the specified range of the array of longs in reverse order.
    static void
    reverseSort(short[] a)
    Sorts the specified array of shorts in reverse order.
    static void
    reverseSort(short[] a, int fromIndex, int toIndex)
    Sorts the specified range of the array of shorts in reverse order.
    static void
    Sorts the specified array of objects in reverse order.
    static void
    reverseSort(Object[] a, int fromIndex, int toIndex)
    Sorts the specified range of the array of objects in reverse order.
    static <T extends Comparable<? super T>>
    void
    reverseSort(List<? extends T> list)
    Sorts the specified list in reverse order.
    static <T extends Comparable<? super T>>
    void
    reverseSort(List<? extends T> list, int fromIndex, int toIndex)
    Sorts the specified range of the list in reverse order.
    static <T, U extends Comparable<? super U>>
    void
    reverseSortBy(List<? extends T> list, Function<? super T,? extends U> keyExtractor)
    Sorts the specified list based on the keys extracted by the provided Function in reverse order.
    static <T, U extends Comparable<? super U>>
    void
    reverseSortBy(T[] a, Function<? super T,? extends U> keyExtractor)
    Sorts the specified array based on the keys extracted by the provided Function in reverse order.
    static <T> void
    reverseSortByDouble(List<? extends T> list, ToDoubleFunction<? super T> keyExtractor)
    Sorts the specified list based on the double values extracted by the provided ToDoubleFunction in reverse order.
    static <T> void
    reverseSortByDouble(T[] a, ToDoubleFunction<? super T> keyExtractor)
    Sorts the specified array based on the double values extracted by the provided ToDoubleFunction in reverse order.
    static <T> void
    reverseSortByFloat(List<? extends T> list, ToFloatFunction<? super T> keyExtractor)
    Sorts the specified list based on the float values extracted by the provided ToFloatFunction in reverse order.
    static <T> void
    reverseSortByFloat(T[] a, ToFloatFunction<? super T> keyExtractor)
    Sorts the specified array based on the float values extracted by the provided ToFloatFunction in reverse order.
    static <T> void
    reverseSortByInt(List<? extends T> list, ToIntFunction<? super T> keyExtractor)
    Sorts the specified list based on the int values extracted by the provided ToIntFunction in reverse order.
    static <T> void
    reverseSortByInt(T[] a, ToIntFunction<? super T> keyExtractor)
    Sorts the specified array based on the int values extracted by the provided ToIntFunction in reverse order.
    static <T> void
    reverseSortByLong(List<? extends T> list, ToLongFunction<? super T> keyExtractor)
    Sorts the specified list based on the long values extracted by the provided ToLongFunction in reverse order.
    static <T> void
    reverseSortByLong(T[] a, ToLongFunction<? super T> keyExtractor)
    Sorts the specified array based on the long values extracted by the provided ToLongFunction in reverse order.
    static <T> List<T>
    reverseToList(Collection<? extends T> c)
    Returns a new list with the elements from the specified collection in reverse order.
    static void
    rotate(boolean[] a, int distance)
    Rotates the elements of the specified boolean array by the specified distance.
    static void
    rotate(byte[] a, int distance)
    Rotates the elements of the specified byte array by the specified distance.
    static void
    rotate(char[] a, int distance)
    Rotates the elements of the specified char array by the specified distance.
    static void
    rotate(double[] a, int distance)
    Rotates the elements of the specified double array by the specified distance.
    static void
    rotate(float[] a, int distance)
    Rotates the elements of the specified float array by the specified distance.
    static void
    rotate(int[] a, int distance)
    Rotates the elements of the specified int array by the specified distance.
    static void
    rotate(long[] a, int distance)
    Rotates the elements of the specified long array by the specified distance.
    static void
    rotate(short[] a, int distance)
    Rotates the elements of the specified short array by the specified distance.
    static void
    rotate(Object[] a, int distance)
    Rotates the elements of the specified Object array by the specified distance.
    static void
    rotate(Collection<?> c, int distance)
    Rotates the elements of the specified collection that has a well-defined encounter order by the specified distance.
    static void
    rotate(List<?> list, int distance)
    Rotates the elements of the specified list by the specified distance.
    static <T, E extends Exception>
    void
    runByBatch(Iterable<? extends T> iter, int batchSize, Throwables.Consumer<? super List<T>,E> batchAction)
    Executes the given action on batches of elements from the provided iterable.
    static <T, E extends Exception, E2 extends Exception>
    void
    runByBatch(Iterable<? extends T> iter, int batchSize, Throwables.IntObjConsumer<? super T,E> elementConsumer, Throwables.Runnable<E2> batchAction)
    Executes the given batch action after applying the specified element consumer on each batch element with index for preparing batch execution.
    static <T, E extends Exception>
    void
    runByBatch(Iterator<? extends T> iter, int batchSize, Throwables.Consumer<? super List<T>,E> batchAction)
    Executes the given action on batches of elements from the provided iterator.
    static <T, E extends Exception, E2 extends Exception>
    void
    runByBatch(Iterator<? extends T> iter, int batchSize, Throwables.IntObjConsumer<? super T,E> elementConsumer, Throwables.Runnable<E2> batchAction)
    Executes the given batch action after applying the specified element consumer on each batch element with index for preparing batch execution.
    static <T, E extends Exception>
    void
    runByBatch(T[] a, int batchSize, Throwables.Consumer<? super List<T>,E> batchAction)
    Executes the given action on batches of elements from the provided array.
    static <T, E extends Exception, E2 extends Exception>
    void
    runByBatch(T[] a, int batchSize, Throwables.IntObjConsumer<? super T,E> elementConsumer, Throwables.Runnable<E2> batchAction)
    Executes the given batch action after applying the specified element consumer on each batch element with index for preparing batch execution.
    static void
    runInParallel(Throwables.Runnable<? extends Exception> command, Throwables.Runnable<? extends Exception> command2)
    Executes and completes the input commands in parallel.
    static void
    runInParallel(Throwables.Runnable<? extends Exception> command, Throwables.Runnable<? extends Exception> command2, Throwables.Runnable<? extends Exception> command3)
    Executes and complete the input commands in parallel.
    static void
    runInParallel(Throwables.Runnable<? extends Exception> command, Throwables.Runnable<? extends Exception> command2, Throwables.Runnable<? extends Exception> command3, Throwables.Runnable<? extends Exception> command4)
    Executes and complete the input commands in parallel.
    static void
    runInParallel(Throwables.Runnable<? extends Exception> command, Throwables.Runnable<? extends Exception> command2, Throwables.Runnable<? extends Exception> command3, Throwables.Runnable<? extends Exception> command4, Throwables.Runnable<? extends Exception> command5)
    Executes and complete the input commands in parallel.
    static void
    runInParallel(Collection<? extends Throwables.Runnable<? extends Exception>> commands)
    Executes the specified collection of commands/tasks in parallel.
    static void
    runInParallel(Collection<? extends Throwables.Runnable<? extends Exception>> commands, Executor executor)
    Executes and complete the input commands in parallel.
    static void
    Note: Copied from Google Guava under Apache License v2.0

    If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.
    static void
    Note: Copied from Google Guava under Apache License v2.0

    If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.
    static void
    Note: Copied from Google Guava under Apache License v2.0

    If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.
    static void
    setAll(boolean[] array, IntToBooleanFunction generator)
    Sets all elements in the given array using the provided generator function.
    static void
    setAll(byte[] array, IntToByteFunction generator)
    Sets all elements in the given array using the provided generator function.
    static void
    setAll(char[] array, IntToCharFunction generator)
    Sets all elements in the given array using the provided generator function.
    static void
    setAll(double[] array, IntToDoubleFunction generator)
    Sets all elements in the given array using the provided generator function.
    static void
    setAll(float[] array, IntToFloatFunction generator)
    Sets all elements in the given array using the provided generator function.
    static void
    setAll(int[] array, IntUnaryOperator generator)
    Sets all elements in the given array using the provided generator function.
    static void
    setAll(long[] array, IntToLongFunction generator)
    Sets all elements in the given array using the provided generator function.
    static void
    setAll(short[] array, IntToShortFunction generator)
    Sets all elements in the given array using the provided generator function.
    static <T, E extends Exception>
    void
    setAll(List<T> list, Throwables.IntObjFunction<? super T,? extends T,E> converter)
    Sets all elements in the given list using the provided converter function.
    static <T> void
    setAll(List<T> list, IntFunction<? extends T> generator)
    Sets all elements in the given list using the provided generator function.
    static <T, E extends Exception>
    void
    setAll(T[] a, Throwables.IntObjFunction<? super T,? extends T,E> converter)
    Sets all elements in the given array using the provided converter function.
    static <T> void
    setAll(T[] array, IntFunction<? extends T> generator)
    Sets all elements in the given array using the provided generator function.
    static void
    setPropValue(Object bean, String propName, Object propValue)
    static void
    shuffle(boolean[] a)
    Shuffles the elements of the specified boolean array.
    static void
    shuffle(boolean[] a, Random rnd)
    Shuffles the elements of the specified boolean array using the specified random number generator.
    static void
    shuffle(byte[] a)
    Shuffles the elements of the specified byte array.
    static void
    shuffle(byte[] a, Random rnd)
    Shuffles the elements of the specified byte array using the specified random number generator.
    static void
    shuffle(char[] a)
    Shuffles the elements of the specified char array.
    static void
    shuffle(char[] a, Random rnd)
    Shuffles the elements of the specified char array using the specified random number generator.
    static void
    shuffle(double[] a)
    Shuffles the elements of the specified double array.
    static void
    shuffle(double[] a, Random rnd)
    Shuffles the elements of the specified double array using the specified random number generator.
    static void
    shuffle(float[] a)
    Shuffles the elements of the specified float array.
    static void
    shuffle(float[] a, Random rnd)
    Shuffles the elements of the specified float array using the specified random number generator.
    static void
    shuffle(int[] a)
    Shuffles the elements of the specified int array.
    static void
    shuffle(int[] a, Random rnd)
    Shuffles the elements of the specified int array using the specified random number generator.
    static void
    shuffle(long[] a)
    Shuffles the elements of the specified long array.
    static void
    shuffle(long[] a, Random rnd)
    Shuffles the elements of the specified long array using the specified random number generator.
    static void
    shuffle(short[] a)
    Shuffles the elements of the specified short array.
    static void
    shuffle(short[] a, Random rnd)
    Shuffles the elements of the specified short array using the specified random number generator.
    static void
    Shuffles the elements of the specified object array.
    static void
    shuffle(Object[] a, Random rnd)
    Shuffles the elements of the specified object array using the specified random number generator.
    static void
    Shuffles the elements of the specified collection that has a well-defined encounter order.
    static void
    Shuffles the elements of the specified collection that has a well-defined encounter order using the specified random number generator.
    static void
    shuffle(List<?> list)
    Shuffles the elements of the specified list.
    static void
    shuffle(List<?> list, Random rnd)
    Shuffles the elements of the specified list using the specified random number generator.
    static int
    Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
    static int
    Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
    static int
    size(Map<?,?> m)
    Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
    static <T> List<T>
    skipRange(Collection<? extends T> c, int startInclusive, int endExclusive)
    Returns a new list with the specified range skipped.
    static <T, C extends Collection<T>>
    C
    skipRange(Collection<? extends T> c, int startInclusive, int endExclusive, IntFunction<C> supplier)
    Returns a new collection with the specified range skipped.
    static <T> T[]
    skipRange(T[] a, int startInclusive, int endExclusive)
    Returns a new array with the specified range skipped.
    static <T> List<T>
    skipUntil(Iterable<? extends T> c, Predicate<? super T> filter)
    Returns a list containing the elements of the input iterable starting from the first element that satisfies the provided predicate.
    static <T> List<T>
    skipUntil(Iterator<? extends T> iter, Predicate<? super T> filter)
    Returns a list containing the elements of the input iterator starting from the first element that satisfies the provided predicate.
    static <T> List<T>
    skipUntil(T[] a, Predicate<? super T> filter)
    Returns a list containing the elements of the input array starting from the first element that satisfies the provided predicate.
    static void
    sleep(long timeoutInMillis)
    Pauses the execution of the current thread for a specified time.
    static void
    sleep(long timeout, TimeUnit unit)
    Pauses the execution of the current thread for a specified time.
    static void
    sleepUninterruptibly(long timeoutInMillis)
    Note: Copied from Google Guava under Apache License v2.0

    If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.
    static void
    sleepUninterruptibly(long timeout, TimeUnit unit)
    Note: Copied from Google Guava under Apache License v2.0

    If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.
    static <T> ImmutableCollection<T>
    slice(Collection<? extends T> c, int fromIndex, int toIndex)
    Returns a read-only slice of the input collection from the specified start index to the end index.
    static <T> ObjIterator<T>
    slice(Iterator<? extends T> iter, int fromIndex, int toIndex)
    Returns a read-only slice of the input iterator from the specified start index to the end index.
    static <T> ImmutableList<T>
    slice(List<? extends T> c, int fromIndex, int toIndex)
    Returns a read-only slice of the input list from the specified start index to the end index.
    static <T> ImmutableList<T>
    slice(T[] a, int fromIndex, int toIndex)
    Returns a read-only slice of the input array from the specified start index to the end index.
    static void
    sort(boolean[] a)
    Sorts the specified array of booleans into ascending order.
    static void
    sort(boolean[] a, int fromIndex, int toIndex)
    Sorts the specified range of the array into ascending order.
    static void
    sort(byte[] a)
    Sorts the specified array into ascending numerical order.
    static void
    sort(byte[] a, int fromIndex, int toIndex)
    Sorts the specified range of the array into ascending order.
    static void
    sort(char[] a)
    Sorts the specified array into ascending order.
    static void
    sort(char[] a, int fromIndex, int toIndex)
    Sorts the specified range of the array into ascending order.
    static void
    sort(double[] a)
    Sorts the specified array into ascending order.
    static void
    sort(double[] a, int fromIndex, int toIndex)
    Sorts the specified range of the array into ascending order.
    static void
    sort(float[] a)
    Sorts the specified array into ascending numerical order.
    static void
    sort(float[] a, int fromIndex, int toIndex)
    Sorts the specified range of the array into ascending order.
    static void
    sort(int[] a)
    Sorts the specified array into ascending numerical order.
    static void
    sort(int[] a, int fromIndex, int toIndex)
    Sorts the specified range of the array into ascending order.
    static void
    sort(long[] a)
    Sorts the specified array into ascending numerical order.
    static void
    sort(long[] a, int fromIndex, int toIndex)
    Sorts the specified range of the array into ascending order.
    static void
    sort(short[] a)
    Sorts the specified array into ascending numerical order.
    static void
    sort(short[] a, int fromIndex, int toIndex)
    Sorts the specified range of the array into ascending order.
    static void
    sort(Object[] a)
    Sorts the specified array according to the natural ordering (where null is smallest).
    static void
    sort(Object[] a, int fromIndex, int toIndex)
    Sorts the specified range of the specified array according to the natural ordering (where null is smallest).
    static <T extends Comparable<? super T>>
    void
    sort(List<? extends T> list)
    Sorts the specified list according to the natural ordering (where null is smallest).
    static <T extends Comparable<? super T>>
    void
    sort(List<? extends T> list, int fromIndex, int toIndex)
    Sorts the specified range of the specified list according to the natural ordering (where null is smallest).
    static <T> void
    sort(List<? extends T> list, int fromIndex, int toIndex, Comparator<? super T> cmp)
    Sorts the specified range of the list according to the order induced by the specified comparator.
    static <T> void
    sort(List<? extends T> list, Comparator<? super T> cmp)
    Sorts the specified list according to the order induced by the specified comparator.
    static <T> void
    sort(T[] a, int fromIndex, int toIndex, Comparator<? super T> cmp)
    Sorts the specified range of the specified array according to the order induced by the specified comparator.
    static <T> void
    sort(T[] a, Comparator<? super T> cmp)
    Sorts the specified array according to the order induced by the specified comparator.
    static <T, U extends Comparable<? super U>>
    void
    sortBy(List<? extends T> list, Function<? super T,? extends U> keyExtractor)
    Sorts the specified list based on the keys extracted by the provided Function.
    static <T, U extends Comparable<? super U>>
    void
    sortBy(T[] a, Function<? super T,? extends U> keyExtractor)
    Sorts the specified array based on the keys extracted by the provided Function.
    static <T> void
    sortByDouble(List<? extends T> list, ToDoubleFunction<? super T> keyExtractor)
    Sorts the specified list into ascending numerical order based on the keys extracted by the provided ToDoubleFunction.
    static <T> void
    sortByDouble(T[] a, ToDoubleFunction<? super T> keyExtractor)
    Sorts the specified array into ascending numerical order based on the keys extracted by the provided ToDoubleFunction.
    static <T> void
    sortByFloat(List<? extends T> list, ToFloatFunction<? super T> keyExtractor)
    Sorts the specified list into ascending numerical order based on the keys extracted by the provided ToFloatFunction.
    static <T> void
    sortByFloat(T[] a, ToFloatFunction<? super T> keyExtractor)
    Sorts the specified array into ascending numerical order based on the keys extracted by the provided ToFloatFunction.
    static <T> void
    sortByInt(List<? extends T> list, ToIntFunction<? super T> keyExtractor)
    Sorts the specified list into ascending numerical order based on the keys extracted by the provided ToIntFunction.
    static <T> void
    sortByInt(T[] a, ToIntFunction<? super T> keyExtractor)
    Sorts the specified array into ascending numerical order based on the keys extracted by the provided ToIntFunction.
    static <T> void
    sortByLong(List<? extends T> list, ToLongFunction<? super T> keyExtractor)
    Sorts the specified list into ascending numerical order based on the keys extracted by the provided ToLongFunction.
    static <T> void
    sortByLong(T[] a, ToLongFunction<? super T> keyExtractor)
    Sorts the specified array into ascending numerical order based on the keys extracted by the provided ToLongFunction.
    static List<boolean[]>
    split(boolean[] a, int chunkSize)
    Splits the input boolean array into sub-arrays of the specified size.
    static List<boolean[]>
    split(boolean[] a, int fromIndex, int toIndex, int chunkSize)
    Splits the input boolean array into sub-arrays of the specified size.
    static List<byte[]>
    split(byte[] a, int chunkSize)
    Splits the input byte array into sub-arrays of the specified size.
    static List<byte[]>
    split(byte[] a, int fromIndex, int toIndex, int chunkSize)
    Splits the input byte array into sub-arrays of the specified size.
    static List<char[]>
    split(char[] a, int chunkSize)
    Splits the input char array into sub-arrays of the specified size.
    static List<char[]>
    split(char[] a, int fromIndex, int toIndex, int chunkSize)
    Splits the input char array into sub-arrays of the specified size.
    static List<double[]>
    split(double[] a, int chunkSize)
    Splits the input double array into sub-arrays of the specified size.
    static List<double[]>
    split(double[] a, int fromIndex, int toIndex, int chunkSize)
    Splits the input double array into sub-arrays of the specified size.
    static List<float[]>
    split(float[] a, int chunkSize)
    Splits the input float array into sub-arrays of the specified size.
    static List<float[]>
    split(float[] a, int fromIndex, int toIndex, int chunkSize)
    Splits the input float array into sub-arrays of the specified size.
    static List<int[]>
    split(int[] a, int chunkSize)
    Splits the input int array into sub-arrays of the specified size.
    static List<int[]>
    split(int[] a, int fromIndex, int toIndex, int chunkSize)
    Splits the input int array into sub-arrays of the specified size.
    static List<long[]>
    split(long[] a, int chunkSize)
    Splits the input long array into sub-arrays of the specified size.
    static List<long[]>
    split(long[] a, int fromIndex, int toIndex, int chunkSize)
    Splits the input long array into sub-arrays of the specified size.
    static List<short[]>
    split(short[] a, int chunkSize)
    Splits the input short array into sub-arrays of the specified size.
    static List<short[]>
    split(short[] a, int fromIndex, int toIndex, int chunkSize)
    Splits the input short array into sub-arrays of the specified size.
    static List<String>
    split(CharSequence str, int chunkSize)
    Returns consecutive substring of the specified string, each of the same length (the final list may be smaller), or an empty array if the specified string is null or empty.
    static List<String>
    split(CharSequence str, int fromIndex, int toIndex, int chunkSize)
    Returns consecutive substring of the specified string, each of the same length (the final list may be smaller), or an empty array if the specified string is null or empty.
    static <T> List<List<T>>
    split(Iterable<? extends T> c, int chunkSize)
    Splits the input iterable into sub-collections of the specified size.
    static <T> List<List<T>>
    split(Collection<? extends T> c, int chunkSize)
    Splits the input collection into sub-collections of the specified size.
    static <T> List<List<T>>
    split(Collection<? extends T> c, int fromIndex, int toIndex, int chunkSize)
    Splits the input collection into sub-collections of the specified size.
    static <T> ObjIterator<List<T>>
    split(Iterator<? extends T> iter, int chunkSize)
    Splits the input iterator into sub-collections of the specified size.
    static <T> List<T[]>
    split(T[] a, int chunkSize)
    Splits the input array into sub-arrays of the specified size.
    static <T> List<T[]>
    split(T[] a, int fromIndex, int toIndex, int chunkSize)
    Splits the input array into sub-arrays of the specified size.
    static <T> List<T>
    splitByChunkCount(int totalSize, int maxChunkCount, boolean sizeSmallerFirst, IntBiFunction<? extends T> func)
    Splits the total size into chunks based on the specified maximum chunk count.
    static <T> List<T>
    splitByChunkCount(int totalSize, int maxChunkCount, IntBiFunction<? extends T> func)
    Splits the total size into chunks based on the specified maximum chunk count.
    static <T> List<List<T>>
    splitByChunkCount(Collection<? extends T> c, int maxChunkCount)
    Splits the input collection into sub-lists based on the specified maximum chunk count.
    static <T> List<List<T>>
    splitByChunkCount(Collection<? extends T> c, int maxChunkCount, boolean sizeSmallerFirst)
    Splits the input collection into sub-lists based on the specified maximum chunk count.
    static <T> Stream<T>
    streamJson(File jsonArray, JSONDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> elementType)
    Creates a stream of elements deserialized from the given JSON array in the specified file with the specified target type and JSONDeserializationConfig.
    static <T> Stream<T>
    streamJson(File jsonArray, JSONDeserializationConfig config, Class<? extends T> elementType)
    Creates a stream of elements deserialized from the given JSON array in the specified file with the specified target type and JSONDeserializationConfig.
    static <T> Stream<T>
    streamJson(File jsonArray, com.landawn.abacus.type.Type<? extends T> elementType)
    Creates a stream of elements deserialized from the given JSON array in the specified file with the specified target type.
    static <T> Stream<T>
    streamJson(File jsonArray, Class<? extends T> elementType)
    Creates a stream of elements deserialized from the given JSON array in the specified file with the specified target type.
    static <T> Stream<T>
    streamJson(InputStream jsonArray, boolean closeInputStreamWhenStreamIsClosed, com.landawn.abacus.type.Type<? extends T> elementType)
    Creates a stream of elements deserialized from the given JSON array in the specified input stream with the specified target type and JSONDeserializationConfig.
    static <T> Stream<T>
    streamJson(InputStream jsonArray, boolean closeInputStreamWhenStreamIsClosed, Class<? extends T> elementType)
    Creates a stream of elements deserialized from the given JSON array in the specified input stream with the specified target type and JSONDeserializationConfig.
    static <T> Stream<T>
    streamJson(InputStream jsonArray, JSONDeserializationConfig config, boolean closeInputStreamWhenStreamIsClosed, com.landawn.abacus.type.Type<? extends T> elementType)
    Creates a stream of elements deserialized from the given JSON array in the specified input stream with the specified target type and JSONDeserializationConfig.
    static <T> Stream<T>
    streamJson(InputStream jsonArray, JSONDeserializationConfig config, boolean closeInputStreamWhenStreamIsClosed, Class<? extends T> elementType)
    Creates a stream of elements deserialized from the given JSON array in the specified input stream with the specified target type and JSONDeserializationConfig.
    static <T> Stream<T>
    streamJson(InputStream jsonArray, com.landawn.abacus.type.Type<? extends T> elementType)
    Creates a stream of elements deserialized from the given JSON array in the specified input stream with the specified target type.
    static <T> Stream<T>
    streamJson(InputStream jsonArray, Class<? extends T> elementType)
    Creates a stream of elements deserialized from the given JSON array in the specified input stream with the specified target type.
    static <T> Stream<T>
    streamJson(Reader jsonArray, boolean closeReaderWhenStreamIsClosed, com.landawn.abacus.type.Type<? extends T> elementType)
    Creates a stream of elements deserialized from the given JSON array in the specified reader with the specified target type and JSONDeserializationConfig.
    static <T> Stream<T>
    streamJson(Reader jsonArray, boolean closeReaderWhenStreamIsClosed, Class<? extends T> elementType)
    Creates a stream of elements deserialized from the given JSON array in the specified reader with the specified target type and JSONDeserializationConfig.
    static <T> Stream<T>
    streamJson(Reader jsonArray, JSONDeserializationConfig config, boolean closeReaderWhenStreamIsClosed, com.landawn.abacus.type.Type<? extends T> elementType)
    Creates a stream of elements deserialized from the given JSON array in the specified reader with the specified target type and JSONDeserializationConfig.
    static <T> Stream<T>
    streamJson(Reader jsonArray, JSONDeserializationConfig config, boolean closeReaderWhenStreamIsClosed, Class<? extends T> elementType)
    Creates a stream of elements deserialized from the given JSON array in the specified reader with the specified target type and JSONDeserializationConfig.
    static <T> Stream<T>
    streamJson(Reader jsonArray, com.landawn.abacus.type.Type<? extends T> elementType)
    Creates a stream of elements deserialized from the given JSON array in the specified reader with the specified target type.
    static <T> Stream<T>
    streamJson(Reader jsonArray, Class<? extends T> elementType)
    Creates a stream of elements deserialized from the given JSON array in the specified reader with the specified target type.
    static <T> Stream<T>
    streamJson(String jsonArray, JSONDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> elementType)
    Creates a stream of elements deserialized from the given JSON array string with the specified target type and JSONDeserializationConfig.
    static <T> Stream<T>
    streamJson(String jsonArray, JSONDeserializationConfig config, Class<? extends T> elementType)
    Creates a stream of elements deserialized from the given JSON array string with the specified target type and JSONDeserializationConfig.
    static <T> Stream<T>
    streamJson(String jsonArray, com.landawn.abacus.type.Type<? extends T> elementType)
    Creates a stream of elements deserialized from the given JSON array string with the specified target type.
    static <T> Stream<T>
    streamJson(String jsonArray, Class<? extends T> elementType)
    Creates a stream of elements deserialized from the given JSON array string with the specified target type.
    static String
    stringOf(boolean val)
    Converts the given value to its corresponding String representation.
    static String
    stringOf(byte val)
    Converts the given value to its corresponding String representation.
    static String
    stringOf(char val)
    Converts the given value to its corresponding String representation.
    static String
    stringOf(double val)
    Converts the given value to its corresponding String representation.
    static String
    stringOf(float val)
    Converts the given value to its corresponding String representation.
    static String
    stringOf(int val)
    Converts the given value to its corresponding String representation.
    static String
    stringOf(long val)
    Converts the given value to its corresponding String representation.
    static String
    stringOf(short val)
    Converts the given value to its corresponding String representation.
    static String
    Converts the given value to its corresponding String representation by Type.stringOf(Object).
    static int
    sum(byte... a)
    Sums all elements in the given array of bytes.
    static int
    sum(byte[] a, int fromIndex, int toIndex)
    Sums all elements within the specified range in the input array of bytes
    static int
    sum(char... a)
    Sums all elements in the given array of characters.
    static int
    sum(char[] a, int fromIndex, int toIndex)
    Sums all elements within the specified range in the input array of characters
    static double
    sum(double... a)
    Sums all elements in the given array of doubles.
    static double
    sum(double[] a, int fromIndex, int toIndex)
    Sums all elements within the specified range in the input array of doubles
    static float
    sum(float... a)
    Sums all elements in the given array of floats.
    static float
    sum(float[] a, int fromIndex, int toIndex)
    Sums all elements within the specified range in the input array of floats
    static int
    sum(int... a)
    Sums all elements in the given array of ints.
    static int
    sum(int[] a, int fromIndex, int toIndex)
    Sums all elements within the specified range in the input array of ints
    static long
    sum(long... a)
    Sums all elements in the given array of longs.
    static long
    sum(long[] a, int fromIndex, int toIndex)
    Sums all elements within the specified range in the input array of longs
    static int
    sum(short... a)
    Sums all elements in the given array of shorts.
    static int
    sum(short[] a, int fromIndex, int toIndex)
    Sums all elements within the specified range in the input array of shorts
    static BigDecimal
    Sums all elements in the given iterable of BigDecimal and returns the result as a BigDecimal.
    static <T> BigDecimal
    sumBigDecimal(Iterable<? extends T> c, Function<? super T,BigDecimal> func)
    Sums all elements in the given iterable using the provided function to convert each element to a BigDecimal.
    static BigInteger
    Sums all elements in the given iterable of BigInteger and returns the result as a BigInteger.
    static <T> BigInteger
    sumBigInteger(Iterable<? extends T> c, Function<? super T,BigInteger> func)
    Sums all elements in the given iterable using the provided function to convert each element to a BigInteger.
    static <T extends Number>
    double
    sumDouble(Iterable<? extends T> c)
    Sums all elements in the given iterable of numbers and returns the result as a double.
    static <T> double
    sumDouble(Iterable<? extends T> c, ToDoubleFunction<? super T> func)
    Sums all elements in the given iterable using the provided function to convert each element to a double.
    static <T extends Number>
    double
    sumDouble(Collection<? extends T> c, int fromIndex, int toIndex)
    Sums all elements within the specified range in the input collection of numbers and returns the result as an double.
    static <T> double
    sumDouble(Collection<? extends T> c, int fromIndex, int toIndex, ToDoubleFunction<? super T> func)
    Sums all elements within the specified range in the input collection using the provided function to convert each element to a double.
    static <T extends Number>
    double
    sumDouble(T[] a)
    Sums all elements in the given array of numbers and returns the result as a double.
    static <T extends Number>
    double
    sumDouble(T[] a, int fromIndex, int toIndex)
    Sums all elements within the specified range in the input array of numbers and returns the result as a double.
    static <T> double
    sumDouble(T[] a, int fromIndex, int toIndex, ToDoubleFunction<? super T> func)
    Sums all elements within the specified range in the input array using the provided function to convert each element to a double.
    static <T> double
    sumDouble(T[] a, ToDoubleFunction<? super T> func)
    Sums all elements in the given array using the provided function to convert each element to a double.
    static <T extends Number>
    int
    sumInt(Iterable<? extends T> c)
    Sums all elements in the given iterable of numbers and returns the result as a integer.
    static <T> int
    sumInt(Iterable<? extends T> c, ToIntFunction<? super T> func)
    Sums all elements in the given iterable using the provided function to convert each element to an integer.
    static <T extends Number>
    int
    sumInt(Collection<? extends T> c, int fromIndex, int toIndex)
    Sums all elements within the specified range in the input collection of numbers and returns the result as an integer.
    static <T> int
    sumInt(Collection<? extends T> c, int fromIndex, int toIndex, ToIntFunction<? super T> func)
    Sums all elements within the specified range in the input collection using the provided function to convert each element to an integer.
    static <T extends Number>
    int
    sumInt(T[] a)
    Sums all elements in the given array of numbers and returns the result as an integer.
    static <T extends Number>
    int
    sumInt(T[] a, int fromIndex, int toIndex)
    Sums all elements within the specified range in the input array of numbers and returns the result as an integer.
    static <T> int
    sumInt(T[] a, int fromIndex, int toIndex, ToIntFunction<? super T> func)
    Sums all elements within the specified range in the input array using the provided function to convert each element to an integer.
    static <T> int
    sumInt(T[] a, ToIntFunction<? super T> func)
    Sums all elements in the given array using the provided function to convert each element to an integer.
    static <T extends Number>
    long
    sumIntToLong(Iterable<? extends T> c)
    Sums all elements in the given iterable of numbers and returns the result as a long.
    static <T> long
    sumIntToLong(Iterable<? extends T> c, ToIntFunction<? super T> func)
    Sums all elements in the given iterable using the provided function to convert each element to an integer and returns the result as a long.
    static <T extends Number>
    long
    sumLong(Iterable<? extends T> c)
    Sums all elements in the given iterable of numbers and returns the result as a long.
    static <T> long
    sumLong(Iterable<? extends T> c, ToLongFunction<? super T> func)
    Sums all elements in the given iterable using the provided function to convert each element to a long.
    static <T extends Number>
    long
    sumLong(Collection<? extends T> c, int fromIndex, int toIndex)
    Sums all elements within the specified range in the input collection of numbers and returns the result as an long.
    static <T> long
    sumLong(Collection<? extends T> c, int fromIndex, int toIndex, ToLongFunction<? super T> func)
    Sums all elements within the specified range in the input collection using the provided function to convert each element to a long.
    static <T extends Number>
    long
    sumLong(T[] a)
    Sums all elements in the given array of numbers and returns the result as a long.
    static <T extends Number>
    long
    sumLong(T[] a, int fromIndex, int toIndex)
    Sums all elements within the specified range in the input array of numbers and returns the result as a long.
    static <T> long
    sumLong(T[] a, int fromIndex, int toIndex, ToLongFunction<? super T> func)
    Sums all elements within the specified range in the input array using the provided function to convert each element to a long.
    static <T> long
    sumLong(T[] a, ToLongFunction<? super T> func)
    Sums all elements in the given array using the provided function to convert each element to a long.
    static double
    sumToDouble(float... a)
    Sums all elements in the given array of floats to a double value.
    static double
    sumToDouble(float[] a, int fromIndex, int toIndex)
    Sums all elements within the specified range in the input array of floats to a double value.
    static long
    sumToLong(int... a)
    Sums all elements in the given array of ints to a long value.
    static long
    sumToLong(int[] a, int fromIndex, int toIndex)
    Sums all elements within the specified range in the input array of ints to a long value.
    static void
    swap(boolean[] a, int i, int j)
    Swaps the elements at the specified positions in the specified boolean array.
    static void
    swap(byte[] a, int i, int j)
    Swaps the elements at the specified positions in the specified byte array.
    static void
    swap(char[] a, int i, int j)
    Swaps the elements at the specified positions in the specified char array.
    static void
    swap(double[] a, int i, int j)
    Swaps the elements at the specified positions in the specified double array.
    static void
    swap(float[] a, int i, int j)
    Swaps the elements at the specified positions in the specified float array.
    static void
    swap(int[] a, int i, int j)
    Swaps the elements at the specified positions in the specified int array.
    static void
    swap(long[] a, int i, int j)
    Swaps the elements at the specified positions in the specified long array.
    static void
    swap(short[] a, int i, int j)
    Swaps the elements at the specified positions in the specified short array.
    static <T> void
    swap(Pair<T,T> pair)
    Swaps the left and right elements in the specified pair.
    static <T, M> void
    swap(Triple<T,M,T> triple)
    Swaps the left and right elements in the specified triple.
    static void
    swap(Object[] a, int i, int j)
    Swaps the elements at the specified positions in the specified Object array.
    static void
    swap(List<?> list, int i, int j)
    Swaps the elements at the specified positions in the specified list.
    static <T> boolean
    swapIf(Pair<T,T> pair, Predicate<? super Pair<T,T>> predicate)
    Swaps the left and right elements in the specified pair if the specified predicate is true.
    static <T, M> boolean
    swapIf(Triple<T,M,T> triple, Predicate<? super Triple<T,M,T>> predicate)
    Swaps the left and right elements in the specified triple if the specified predicate is true.
    static boolean[]
    symmetricDifference(boolean[] a, boolean[] b)
    Returns the elements that are present in either a or b but not in both.
    static byte[]
    symmetricDifference(byte[] a, byte[] b)
    Returns the elements that are present in either a or b but not in both.
    static char[]
    symmetricDifference(char[] a, char[] b)
    Returns the elements that are present in either a or b but not in both.
    static double[]
    symmetricDifference(double[] a, double[] b)
    Returns the elements that are present in either a or b but not in both.
    static float[]
    symmetricDifference(float[] a, float[] b)
    Returns the elements that are present in either a or b but not in both.
    static int[]
    symmetricDifference(int[] a, int[] b)
    Returns the elements that are present in either a or b but not in both.
    static long[]
    symmetricDifference(long[] a, long[] b)
    Returns the elements that are present in either a or b but not in both.
    static short[]
    symmetricDifference(short[] a, short[] b)
    Returns the elements that are present in either a or b but not in both.
    static <T> List<T>
    symmetricDifference(Collection<? extends T> a, Collection<? extends T> b)
    Returns the elements that are present in either a or b but not in both.
    static <T> List<T>
    symmetricDifference(T[] a, T[] b)
    Returns the elements that are present in either a or b but not in both.
    static <T> List<T>
    takeWhile(Iterable<? extends T> c, Predicate<? super T> filter)
    Returns a list containing the elements of the input iterable until the provided predicate returns false.
    static <T> List<T>
    takeWhile(Iterator<? extends T> iter, Predicate<? super T> filter)
    Returns a list containing the elements of the input iterator until the provided predicate returns false.
    static <T> List<T>
    takeWhile(T[] a, Predicate<? super T> filter)
    Returns a list containing the elements of the input array until the provided predicate returns false.
    static <T> List<T>
    takeWhileInclusive(Iterable<? extends T> c, Predicate<? super T> filter)
    Returns a list containing the elements of the input iterable until the provided predicate returns false, including the element that fails the predicate.
    static <T> List<T>
    takeWhileInclusive(Iterator<? extends T> iter, Predicate<? super T> filter)
    Returns a list containing the elements of the input iterator until the provided predicate returns false, including the element that fails the predicate.
    static <T> List<T>
    takeWhileInclusive(T[] a, Predicate<? super T> filter)
    Returns a list containing the elements of the input array until the provided predicate returns false, including the element that fails the predicate.
    static Object[]
    Converts the specified collection to an array.
    static Object[]
    toArray(Collection<?> c, int fromIndex, int toIndex)
    Converts the specified range in the specified collection into an array.
    static <A, T extends A>
    A[]
    toArray(Collection<? extends T> c, int fromIndex, int toIndex, A[] a)
    Converts the specified range in the specified collection into an array.
    static <A, T extends A>
    A[]
    toArray(Collection<? extends T> c, int fromIndex, int toIndex, Class<A[]> targetType)
    Converts the specified range in the specified collection into an array of a specified type.
    static <A, T extends A>
    A[]
    toArray(Collection<? extends T> c, int fromIndex, int toIndex, IntFunction<A[]> arraySupplier)
    Converts the specified range in the specified collection into an array using a provided array supplier function.
    static <A, T extends A>
    A[]
    toArray(Collection<? extends T> c, A[] a)
    Converts a collection into an array.
    static <A, T extends A>
    A[]
    toArray(Collection<? extends T> c, Class<A[]> targetType)
    Converts a collection into an array of a specified type.
    static <A, T extends A>
    A[]
    toArray(Collection<? extends T> c, IntFunction<A[]> arraySupplier)
    Converts a collection into an array using a provided array supplier function.
    static boolean[]
    toBooleanArray(byte[] a)
    Converts a byte array to a boolean array.
    static boolean[]
    toBooleanArray(int[] a)
    Converts an integer array to a boolean array.
    static boolean[]
    Converts a collection of Boolean objects to a boolean array.
    static boolean[]
    toBooleanArray(Collection<Boolean> c, boolean defaultForNull)
    Converts a collection of Boolean objects to a boolean array.
    static boolean[]
    toBooleanArray(Collection<Boolean> c, int fromIndex, int toIndex)
    Converts the specified range of the specified Boolean collection to a boolean array.
    static boolean[]
    toBooleanArray(Collection<Boolean> c, int fromIndex, int toIndex, boolean defaultForNull)
    Converts the specified range of the specified Boolean collection to a boolean array.
    static byte[]
    toByteArray(boolean[] a)
    Converts a boolean array to a byte array.
    static byte[]
    Converts a collection of Number objects to a byte array.
    static byte[]
    toByteArray(Collection<? extends Number> c, byte defaultForNull)
    Converts a collection of Number objects to a byte array.
    static byte[]
    toByteArray(Collection<? extends Number> c, int fromIndex, int toIndex)
    Converts the specified range of the specified Number collection to a byte array.
    static byte[]
    toByteArray(Collection<? extends Number> c, int fromIndex, int toIndex, byte defaultForNull)
    Converts the specified range of the specified Number collection to a byte array.
    static char[]
    Converts a collection of Character objects to a char array.
    static char[]
    toCharArray(Collection<Character> c, char defaultForNull)
    Converts a collection of Character objects to a char array.
    static char[]
    toCharArray(Collection<Character> c, int fromIndex, int toIndex)
    Converts the specified range of the specified character collection to a char array.
    static char[]
    toCharArray(Collection<Character> c, int fromIndex, int toIndex, char defaultForNull)
    Converts the specified range of the specified character collection to a char array.
    static <C extends Collection<Boolean>>
    C
    toCollection(boolean[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier)
    Converts the specified range of the boolean array to a specified type of Collection.
    static <C extends Collection<Boolean>>
    C
    toCollection(boolean[] a, IntFunction<? extends C> supplier)
    Converts a boolean array to a specified type of Collection.
    static <C extends Collection<Byte>>
    C
    toCollection(byte[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier)
    Converts the specified range of the byte array to a specified type of Collection.
    static <C extends Collection<Byte>>
    C
    toCollection(byte[] a, IntFunction<? extends C> supplier)
    Converts a byte array to a specified type of Collection.
    static <C extends Collection<Character>>
    C
    toCollection(char[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier)
    Converts the specified range of the char array to a specified type of Collection.
    static <C extends Collection<Character>>
    C
    toCollection(char[] a, IntFunction<? extends C> supplier)
    Converts a char array to a specified type of Collection.
    static <C extends Collection<Double>>
    C
    toCollection(double[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier)
    Converts the specified range of the double array to a specified type of Collection.
    static <C extends Collection<Double>>
    C
    toCollection(double[] a, IntFunction<? extends C> supplier)
    Converts a double array to a specified type of Collection.
    static <C extends Collection<Float>>
    C
    toCollection(float[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier)
    Converts the specified range of the float array to a specified type of Collection.
    static <C extends Collection<Float>>
    C
    toCollection(float[] a, IntFunction<? extends C> supplier)
    Converts a float array to a specified type of Collection.
    static <C extends Collection<Integer>>
    C
    toCollection(int[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier)
    Converts the specified range of the int array to a specified type of Collection.
    static <C extends Collection<Integer>>
    C
    toCollection(int[] a, IntFunction<? extends C> supplier)
    Converts an int array to a specified type of Collection.
    static <C extends Collection<Long>>
    C
    toCollection(long[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier)
    Converts the specified range of the long array to a specified type of Collection.
    static <C extends Collection<Long>>
    C
    toCollection(long[] a, IntFunction<? extends C> supplier)
    Converts a long array to a specified type of Collection.
    static <C extends Collection<Short>>
    C
    toCollection(short[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier)
    Converts the specified range of the short array to a specified type of Collection.
    static <C extends Collection<Short>>
    C
    toCollection(short[] a, IntFunction<? extends C> supplier)
    Converts a short array to a specified type of Collection.
    static <T, C extends Collection<T>>
    C
    toCollection(Iterable<? extends T> c, IntFunction<? extends C> supplier)
    Converts an Iterable to a specified type of Collection.
    static <T, C extends Collection<T>>
    C
    toCollection(Iterator<? extends T> iter, Supplier<? extends C> supplier)
    Converts an Iterator to a specified type of Collection.
    static <T, C extends Collection<T>>
    C
    toCollection(T[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier)
    Converts the specified range of the array to a specified type of Collection.
    static <T, C extends Collection<T>>
    C
    toCollection(T[] a, IntFunction<? extends C> supplier)
    Converts an array of objects to a specified type of Collection.
    static double[]
    Converts a collection of Number objects to a double array.
    static double[]
    toDoubleArray(Collection<? extends Number> c, double defaultForNull)
    Converts a collection of Number objects to a double array.
    static double[]
    toDoubleArray(Collection<? extends Number> c, int fromIndex, int toIndex)
    Converts the specified range of the specified Number collection to a double array.
    static double[]
    toDoubleArray(Collection<? extends Number> c, int fromIndex, int toIndex, double defaultForNull)
    Converts the specified range of the specified Number collection to a double array.
    static float[]
    Converts a collection of Number objects to a float array.
    static float[]
    toFloatArray(Collection<? extends Number> c, float defaultForNull)
    Converts a collection of Number objects to a float array.
    static float[]
    toFloatArray(Collection<? extends Number> c, int fromIndex, int toIndex)
    Converts the specified range of the specified Number collection to a float array.
    static float[]
    toFloatArray(Collection<? extends Number> c, int fromIndex, int toIndex, float defaultForNull)
    Converts the specified range of the specified Number collection to a float array.
    static int[]
    toIntArray(boolean[] a)
    Converts a boolean array to an int array.
    static int[]
    toIntArray(char[] a)
    Converts a char array to an int array.
    static int[]
    Converts a collection of Number objects to an int array.
    static int[]
    toIntArray(Collection<? extends Number> c, int defaultForNull)
    Converts a collection of Number objects to an int array.
    static int[]
    toIntArray(Collection<? extends Number> c, int fromIndex, int toIndex)
    Converts the specified range of the specified Number collection to an int array.
    static int[]
    toIntArray(Collection<? extends Number> c, int fromIndex, int toIndex, int defaultForNull)
    Converts the specified range of the specified Number collection to an int array.
    static String
    Converts the given object to its JSON string representation.
    static String
    toJson(Object obj, boolean prettyFormat)
    Converts the given object to its JSON string representation with an option for pretty formatting.
    static String
    Converts the given object to its JSON string representation with the specified JSONSerializationConfig.
    static void
    toJson(Object obj, JSONSerializationConfig config, File output)
    Converts the given object to its JSON string representation with an option for pretty formatting and writes it to the specified file.
    static void
    Converts the given object to its JSON string representation with an option for pretty formatting and writes it to the specified output stream.
    static void
    Converts the given object to its JSON string representation with an option for pretty formatting and writes it to the specified writer.
    static void
    toJson(Object obj, File output)
    Converts the given object to its JSON string representation and writes it to the specified file.
    static void
    toJson(Object obj, OutputStream output)
    Converts the given object to its JSON string representation and writes it to the specified output stream.
    static void
    toJson(Object obj, Writer output)
    Converts the given object to its JSON string representation and writes it to the specified writer.
    static List<Boolean>
    toList(boolean[] a)
    Converts a boolean array to a modifiable List, which is NOT backed with the input array
    static List<Boolean>
    toList(boolean[] a, int fromIndex, int toIndex)
    Converts the specified range of the array to a modifiable List, which is NOT backed with the input array
    static List<Byte>
    toList(byte[] a)
    Converts a byte array to a modifiable List, which is NOT backed with the input array
    static List<Byte>
    toList(byte[] a, int fromIndex, int toIndex)
    Converts the specified range of the byte array to a modifiable List, which is NOT backed with the input array
    static List<Character>
    toList(char[] a)
    Converts a char array to a modifiable List, which is NOT backed with the input array
    static List<Character>
    toList(char[] a, int fromIndex, int toIndex)
    Converts the specified range of the array to a modifiable List, which is NOT backed with the input array
    static List<Double>
    toList(double[] a)
    Converts a double array to a modifiable List, which is NOT backed with the input array
    static List<Double>
    toList(double[] a, int fromIndex, int toIndex)
    Converts the specified range of the double array to a modifiable List, which is NOT backed with the input array
    static List<Float>
    toList(float[] a)
    Converts a float array to a modifiable List, which is NOT backed with the input array
    static List<Float>
    toList(float[] a, int fromIndex, int toIndex)
    Converts the specified range of the float array to a modifiable List, which is NOT backed with the input array
    static List<Integer>
    toList(int[] a)
    Converts an int array to a modifiable List, which is NOT backed with the input array
    static List<Integer>
    toList(int[] a, int fromIndex, int toIndex)
    Converts the specified range of the int array to a modifiable List, which is NOT backed with the input array
    static List<Long>
    toList(long[] a)
    Converts a long array to a modifiable List, which is NOT backed with the input array
    static List<Long>
    toList(long[] a, int fromIndex, int toIndex)
    Converts the specified range of the long array to a modifiable List, which is NOT backed with the input array
    static List<Short>
    toList(short[] a)
    Converts a short array to a modifiable List, which is NOT backed with the input array
    static List<Short>
    toList(short[] a, int fromIndex, int toIndex)
    Converts the specified range of the short array to a modifiable List, which is NOT backed with the input array
    static <T> List<T>
    toList(Iterator<? extends T> iter)
    Converts an Iterator of objects to a modifiable List.
    static <T> List<T>
    toList(T[] a)
    Converts an array of objects to a modifiable List, which is NOT backed with the input array.
    static <T> List<T>
    toList(T[] a, int fromIndex, int toIndex)
    Converts the specified range of the array to a modifiable List, which is NOT backed with the input array.
    static long[]
    Converts a collection of Number objects to a long array.
    static long[]
    toLongArray(Collection<? extends Number> c, int fromIndex, int toIndex)
    Converts the specified range of the specified Number collection to a long array.
    static long[]
    toLongArray(Collection<? extends Number> c, int fromIndex, int toIndex, long defaultForNull)
    Converts the specified range of the specified Number collection to a long array.
    static long[]
    toLongArray(Collection<? extends Number> c, long defaultForNull)
    Converts a collection of Number objects to a long array.
    static <T, K> Map<K,T>
    toMap(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor)
    Converts an Iterable to a Map using a key extractor function.
    static <T, K, V> Map<K,V>
    toMap(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor, Function<? super T,? extends V> valueExtractor)
    Converts an Iterable to a Map using key and value extractor functions.
    static <T, K, V, M extends Map<K, V>>
    M
    toMap(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor, Function<? super T,? extends V> valueExtractor, BiFunction<? super V,? super V,? extends V> mergeFunction, IntFunction<? extends M> mapSupplier)
    Converts an Iterable to a Map using key and value extractor functions, with a custom Map supplier.
    static <T, K, V, M extends Map<K, V>>
    M
    toMap(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor, Function<? super T,? extends V> valueExtractor, IntFunction<? extends M> mapSupplier)
    Converts an Iterable to a Map using key and value extractor functions, with a custom Map supplier.
    static <T, K> Map<K,T>
    toMap(Iterator<? extends T> iter, Function<? super T,K> keyExtractor)
    Converts an Iterator to a Map using a key extractor function.
    static <T, K, V> Map<K,V>
    toMap(Iterator<? extends T> iter, Function<? super T,K> keyExtractor, Function<? super T,? extends V> valueExtractor)
    Converts an Iterator to a Map using key and value extractor functions.
    static <T, K, V, M extends Map<K, V>>
    M
    toMap(Iterator<? extends T> iter, Function<? super T,K> keyExtractor, Function<? super T,? extends V> valueExtractor, BiFunction<? super V,? super V,? extends V> mergeFunction, Supplier<? extends M> mapSupplier)
    Converts an Iterator to a Map using key and value extractor functions, with a custom Map supplier.
    static <T, K, V, M extends Map<K, V>>
    M
    toMap(Iterator<? extends T> iter, Function<? super T,K> keyExtractor, Function<? super T,? extends V> valueExtractor, Supplier<? extends M> mapSupplier)
    Converts an Iterator to a Map using key and value extractor functions, with a custom Map supplier.
    static double[]
    top(double[] a, int n)
    Returns the top n elements from the specified array.
    static double[]
    top(double[] a, int fromIndex, int toIndex, int n)
    Returns the top n elements from a specified range in the input array.
    static double[]
    top(double[] a, int fromIndex, int toIndex, int n, Comparator<? super Double> cmp)
    Returns the top n elements from a specified range in the input array according to the provided comparator.
    static double[]
    top(double[] a, int n, Comparator<? super Double> cmp)
    Returns the top n elements from the specified array according to the provided comparator.
    static float[]
    top(float[] a, int n)
    Returns the top n elements from the specified array.
    static float[]
    top(float[] a, int fromIndex, int toIndex, int n)
    Returns the top n elements from a specified range in the input array.
    static float[]
    top(float[] a, int fromIndex, int toIndex, int n, Comparator<? super Float> cmp)
    Returns the top n elements from a specified range in the input array according to the provided comparator.
    static float[]
    top(float[] a, int n, Comparator<? super Float> cmp)
    Returns the top n elements from the specified array according to the provided comparator.
    static int[]
    top(int[] a, int n)
    Returns the top n elements from the specified array.
    static int[]
    top(int[] a, int fromIndex, int toIndex, int n)
    Returns the top n elements from a specified range in the input array.
    static int[]
    top(int[] a, int fromIndex, int toIndex, int n, Comparator<? super Integer> cmp)
    Returns the top n elements from a specified range in the input array according to the provided comparator.
    static int[]
    top(int[] a, int n, Comparator<? super Integer> cmp)
    Returns the top n elements from the specified array according to the provided comparator.
    static long[]
    top(long[] a, int n)
    Returns the top n elements from the specified array.
    static long[]
    top(long[] a, int fromIndex, int toIndex, int n)
    Returns the top n elements from a specified range in the input array.
    static long[]
    top(long[] a, int fromIndex, int toIndex, int n, Comparator<? super Long> cmp)
    Returns the top n elements from a specified range in the input array according to the provided comparator.
    static long[]
    top(long[] a, int n, Comparator<? super Long> cmp)
    Returns the top n elements from the specified array according to the provided comparator.
    static short[]
    top(short[] a, int n)
    Returns the top n elements from the specified array.
    static short[]
    top(short[] a, int fromIndex, int toIndex, int n)
    Returns the top n elements from a specified range in the input array.
    static short[]
    top(short[] a, int fromIndex, int toIndex, int n, Comparator<? super Short> cmp)
    Returns the top n elements from a specified range in the input array according to the provided comparator.
    static short[]
    top(short[] a, int n, Comparator<? super Short> cmp)
    Returns the top n elements from the specified array according to the provided comparator.
    static <T extends Comparable<? super T>>
    List<T>
    top(Collection<? extends T> c, int n)
    Returns the top n elements from the specified collection based on their natural ordering.
    static <T extends Comparable<? super T>>
    List<T>
    top(Collection<? extends T> c, int n, boolean keepEncounterOrder)
    Returns the top n elements from the specified collection based on their natural ordering.
    static <T extends Comparable<? super T>>
    List<T>
    top(Collection<? extends T> c, int fromIndex, int toIndex, int n)
    Returns the top n elements from the specified range in the input collection based on their natural ordering.
    static <T extends Comparable<? super T>>
    List<T>
    top(Collection<? extends T> c, int fromIndex, int toIndex, int n, boolean keepEncounterOrder)
    Returns the top n elements from the specified range in the input collection based on their natural ordering.
    static <T> List<T>
    top(Collection<? extends T> c, int fromIndex, int toIndex, int n, Comparator<? super T> cmp)
    Returns the top n elements from the specified range in the input collection according to the provided comparator.
    static <T> List<T>
    top(Collection<? extends T> c, int fromIndex, int toIndex, int n, Comparator<? super T> cmp, boolean keepEncounterOrder)
    Returns the top n elements from the specified range in the input collection according to the provided comparator.
    static <T> List<T>
    top(Collection<? extends T> c, int n, Comparator<? super T> cmp)
    Returns the top n elements from the specified collection according to the provided comparator.
    static <T> List<T>
    top(Collection<? extends T> c, int n, Comparator<? super T> cmp, boolean keepEncounterOrder)
    Returns the top n elements from the specified collection according to the provided comparator.
    static <T extends Comparable<? super T>>
    List<T>
    top(T[] a, int n)
    Returns the top n elements from the specified array based on their natural ordering.
    static <T extends Comparable<? super T>>
    List<T>
    top(T[] a, int n, boolean keepEncounterOrder)
    Returns the top n elements from the specified array based on their natural ordering.
    static <T extends Comparable<? super T>>
    List<T>
    top(T[] a, int fromIndex, int toIndex, int n)
    Returns the top n elements from the specified range in the input array based on their natural ordering.
    static <T extends Comparable<? super T>>
    List<T>
    top(T[] a, int fromIndex, int toIndex, int n, boolean keepEncounterOrder)
    Returns the top n elements from the specified range in the input array based on their natural ordering.
    static <T> List<T>
    top(T[] a, int fromIndex, int toIndex, int n, Comparator<? super T> cmp)
    Returns the top n elements from the specified range in the input array according to the provided comparator.
    static <T> List<T>
    top(T[] a, int fromIndex, int toIndex, int n, Comparator<? super T> cmp, boolean keepEncounterOrder)
    Returns the top n elements from the specified range in the input array according to the provided comparator.
    static <T> List<T>
    top(T[] a, int n, Comparator<? super T> cmp)
    Returns the top n elements from the specified array according to the provided comparator.
    static <T> List<T>
    top(T[] a, int n, Comparator<? super T> cmp, boolean keepEncounterOrder)
    Returns the top n elements from the specified array according to the provided comparator.
    Converts the provided exception to a runtime exception.
    Converts the specified Throwable to a RuntimeException if it's a checked exception or an Error, otherwise returns itself.
    toRuntimeException(Throwable e, boolean throwIfItIsError)
    Converts the specified Throwable to a RuntimeException if it's a checked exception, or throws it if it's an Error, based on the provided flag.
    static Set<Boolean>
    toSet(boolean[] a)
    Converts a boolean array to a modifiable Set, which is NOT backed with the input array.
    static Set<Boolean>
    toSet(boolean[] a, int fromIndex, int toIndex)
    Converts the specified range of the boolean array to a modifiable Set, which is NOT backed with the input array.
    static Set<Byte>
    toSet(byte[] a)
    Converts a byte array to a modifiable Set, which is NOT backed with the input array.
    static Set<Byte>
    toSet(byte[] a, int fromIndex, int toIndex)
    Converts the specified range of the byte array to a modifiable Set, which is NOT backed with the input array.
    static Set<Character>
    toSet(char[] a)
    Converts a char array to a modifiable Set, which is NOT backed with the input array.
    static Set<Character>
    toSet(char[] a, int fromIndex, int toIndex)
    Converts the specified range of the char array to a modifiable Set, which is NOT backed with the input array.
    static Set<Double>
    toSet(double[] a)
    Converts a double array to a modifiable Set, which is NOT backed with the input array.
    static Set<Double>
    toSet(double[] a, int fromIndex, int toIndex)
    Converts the specified range of the double array to a modifiable Set, which is NOT backed with the input array.
    static Set<Float>
    toSet(float[] a)
    Converts a float array to a Set of, which is NOT backed with the input array.
    static Set<Float>
    toSet(float[] a, int fromIndex, int toIndex)
    Converts the specified range of the float array to a modifiable Set, which is NOT backed with the input array.
    static Set<Integer>
    toSet(int[] a)
    Converts an int array to a modifiable Set, which is NOT backed with the input array.
    static Set<Integer>
    toSet(int[] a, int fromIndex, int toIndex)
    Converts the specified range of the int array to a modifiable Set, which is NOT backed with the input array.
    static Set<Long>
    toSet(long[] a)
    Converts a long array to a modifiable Set, which is NOT backed with the input array.
    static Set<Long>
    toSet(long[] a, int fromIndex, int toIndex)
    Converts the specified range of the long array to a modifiable Set, which is NOT backed with the input array.
    static Set<Short>
    toSet(short[] a)
    Converts a short array to a modifiable Set, which is NOT backed with the input array.
    static Set<Short>
    toSet(short[] a, int fromIndex, int toIndex)
    Converts the specified range of the short array to a modifiable Set, which is NOT backed with the input array.
    static <T> Set<T>
    toSet(Iterator<? extends T> iter)
    Converts an Iterator of objects to a modifiable Set.
    static <T> Set<T>
    toSet(T[] a)
    Converts an array of objects to a modifiable Set, which is NOT backed with the input array.
    static <T> Set<T>
    toSet(T[] a, int fromIndex, int toIndex)
    Converts the specified range of the array to a modifiable Set, which is NOT backed with the input array.
    static short[]
    Converts a collection of Number objects to a short array.
    static short[]
    toShortArray(Collection<? extends Number> c, int fromIndex, int toIndex)
    Converts the specified range of the specified Number collection to a short array.
    static short[]
    toShortArray(Collection<? extends Number> c, int fromIndex, int toIndex, short defaultForNull)
    Converts the specified range of the specified Number collection to a short array.
    static short[]
    toShortArray(Collection<? extends Number> c, short defaultForNull)
    Converts a collection of Number objects to a short array.
    static String
    toString(boolean value)
    Returns a string representation of the specified boolean value.
    static String
    toString(boolean[] a)
    Returns a string representation of the specified boolean array.
    static String
    toString(boolean[] a, int fromIndex, int toIndex)
    Returns a string representation of the specified range of elements in a boolean array.
    static String
    toString(byte value)
    Returns a string representation of the specified byte value.
    static String
    toString(byte[] a)
    Returns a string representation of the specified byte array.
    static String
    toString(byte[] a, int fromIndex, int toIndex)
    Returns a string representation of the specified range of elements in a byte array.
    static String
    toString(char value)
    Returns a string representation of the specified char value.
    static String
    toString(char[] a)
    Returns a string representation of the specified char array.
    static String
    toString(char[] a, int fromIndex, int toIndex)
    Returns a string representation of the specified range of elements in a char array.
    static String
    toString(double value)
    Returns a string representation of the specified double value.
    static String
    toString(double[] a)
    Returns a string representation of the specified double array.
    static String
    toString(double[] a, int fromIndex, int toIndex)
    Returns a string representation of the specified range of elements in a double array.
    static String
    toString(float value)
    Returns a string representation of the specified float value.
    static String
    toString(float[] a)
    Returns a string representation of the specified float array.
    static String
    toString(float[] a, int fromIndex, int toIndex)
    Returns a string representation of the specified range of elements in a float array.
    static String
    toString(int value)
    Returns a string representation of the specified int value.
    static String
    toString(int[] a)
    Returns a string representation of the specified int array.
    static String
    toString(int[] a, int fromIndex, int toIndex)
    Returns a string representation of the specified range of elements in an int array.
    static String
    toString(long value)
    Returns a string representation of the specified long value.
    static String
    toString(long[] a)
    Returns a string representation of the specified long array.
    static String
    toString(long[] a, int fromIndex, int toIndex)
    Returns a string representation of the specified range of elements in a long array.
    static String
    toString(short value)
    Returns a string representation of the specified short value.
    static String
    toString(short[] a)
    Returns a string representation of the specified short array.
    static String
    toString(short[] a, int fromIndex, int toIndex)
    Returns a string representation of the specified range of elements in a short array.
    static String
    Returns a string representation of the specified object.
    static String
    Returns a string representation of the specified Object array.
    static String
    toString(Object[] a, int fromIndex, int toIndex)
    Returns a string representation of the specified range of elements in an Object array.
    static String
    toString(Object a, String defaultIfNull)
    Returns a string representation of the specified object.
    static String
    Converts the given object into an XML string representation.
    static String
    toXml(Object obj, boolean prettyFormat)
    Converts the given object to its XML string representation with an option for pretty formatting.
    static String
    Converts the given object to its XML string representation with the specified XMLSerializationConfig.
    static void
    toXml(Object obj, XMLSerializationConfig config, File output)
    Converts the given object to its XML string representation with the specified XMLSerializationConfig and writes it to the specified file.
    static void
    Converts the given object to its XML string representation with the specified XMLSerializationConfig and writes it to the specified output stream.
    static void
    toXml(Object obj, XMLSerializationConfig config, Writer output)
    Converts the given object to its XML string representation with the specified XMLSerializationConfig and writes it to the specified writer.
    static void
    toXml(Object obj, File output)
    Converts the given object to its XML string representation and writes it to the specified file.
    static void
    toXml(Object obj, OutputStream output)
    Converts the given object to its XML string representation and writes it to the specified output stream.
    static void
    toXml(Object obj, Writer output)
    Converts the given object to its XML string representation and writes it to the specified writer.
    static <R> R
    tryOrDefaultIfExceptionOccurred(Callable<R> cmd, Supplier<R> supplierForDefaultIfExceptionOccurred)
    Executes the given Callable and returns the result.
    static <R> R
    tryOrDefaultIfExceptionOccurred(Callable<R> cmd, R defaultIfExceptionOccurred)
    Executes the given Callable and returns the result.
    static <T, R> R
    tryOrDefaultIfExceptionOccurred(T init, Throwables.Function<? super T,? extends R,? extends Exception> func, Supplier<R> supplierForDefaultIfExceptionOccurred)
    Executes the given function with the provided initial value and returns the result.
    static <T, R> R
    tryOrDefaultIfExceptionOccurred(T init, Throwables.Function<? super T,? extends R,? extends Exception> func, R defaultIfExceptionOccurred)
    Executes the given function with the provided initial value and returns the result.
    static <R> u.Nullable<R>
    Executes the given Callable and returns a Nullable containing the result.
    static <T, R> u.Nullable<R>
    tryOrEmptyIfExceptionOccurred(T init, Throwables.Function<? super T,? extends R,? extends Exception> func)
    Executes the given function with the provided initial value and returns a Nullable containing the result.
    static <T> com.landawn.abacus.type.Type<T>
    typeOf(Class<?> cls)
    Gets a Type by the given Class.
    static <T> com.landawn.abacus.type.Type<T>
    typeOf(String typeName)
    Gets a Type by the given type name.
    static <T> Collection<T>
    Returns an unmodifiable view of the specified collection, or an immutable/unmodifiable empty collection if the specified collection is null.
    static <T> List<T>
    unmodifiableList(List<? extends T> list)
    Returns an unmodifiable view of the specified list, or an immutable/unmodifiable empty list if the specified list is null.
    static <K, V> Map<K,V>
    unmodifiableMap(Map<? extends K,? extends V> m)
    Returns an unmodifiable view of the specified map, or an immutable/unmodifiable empty map if the specified map is null.
    static <K, V> NavigableMap<K,V>
    Returns an unmodifiable view of the specified navigable map, or an immutable/unmodifiable empty navigable map if the specified map is null.
    static <T> NavigableSet<T>
    Returns an unmodifiable view of the specified navigable set, or an immutable/unmodifiable empty navigable set if the specified navigable set is null.
    static <T> Set<T>
    unmodifiableSet(Set<? extends T> s)
    Returns an unmodifiable view of the specified set, or an immutable/unmodifiable empty set if the specified set is null.
    static <K, V> SortedMap<K,V>
    unmodifiableSortedMap(SortedMap<K,? extends V> m)
    Returns an unmodifiable view of the specified sorted map, or an immutable/unmodifiable empty sorted map if the specified map is null.
    static <T> SortedSet<T>
    Returns an unmodifiable view of the specified sorted set, or an immutable/unmodifiable empty sorted set if the specified sorted set is null.
    static <T, A, B> Pair<List<A>,List<B>>
    unzip(Iterable<? extends T> c, BiConsumer<? super T,Pair<A,B>> unzip)
    Unzips an iterable into two separate lists using the provided unzip function.
    static <T, A, B, LC extends Collection<A>, RC extends Collection<B>>
    Pair<LC,RC>
    unzip(Iterable<? extends T> c, BiConsumer<? super T,Pair<A,B>> unzip, IntFunction<? extends Collection<?>> supplier)
    Unzips an iterable into two separate collections using the provided unzip function.
    static <T, A, B, C>
    Triple<List<A>,List<B>,List<C>>
    unzipp(Iterable<? extends T> c, BiConsumer<? super T,Triple<A,B,C>> unzip)
    static <T, A, B, C, LC extends Collection<A>, MC extends Collection<B>, RC extends Collection<C>>
    Triple<LC,MC,RC>
    unzipp(Iterable<? extends T> c, BiConsumer<? super T,Triple<A,B,C>> unzip, IntFunction<? extends Collection<?>> supplier)
    Deprecated.
    replaced by
    invalid reference
    TriIterator#unzip(Iterable, BiConsumer, Supplier)
    static void
    Deprecated.
    use replaceAll
    static void
    Deprecated.
    use replaceIf
    static <T> T
    valueOf(String str, Class<? extends T> targetType)
    Converts the given string to its corresponding value of the specified target type by typeOf(targetType).valueOf(str).
    static String
    Converts the given XML string to its JSON string representation.
    static String
    xml2Json(String xml, Class<?> transferType)
    Converts the given XML string to its JSON string representation.
    static <A, B, R> List<R>
    zip(A[] a, B[] b, A valueForNoneA, B valueForNoneB, BiFunction<? super A,? super B,? extends R> zipFunction)
    Zips two arrays into a single list using the provided zip function.
    static <A, B, R> R[]
    zip(A[] a, B[] b, A valueForNoneA, B valueForNoneB, BiFunction<? super A,? super B,? extends R> zipFunction, Class<R> targetElementType)
    Zips two arrays into a single array using the provided zip function.
    static <A, B, C, R>
    List<R>
    zip(A[] a, B[] b, C[] c, A valueForNoneA, B valueForNoneB, C valueForNoneC, TriFunction<? super A,? super B,? super C,? extends R> zipFunction)
    Zips three arrays into a single list using the provided zip function.
    static <A, B, C, R>
    R[]
    zip(A[] a, B[] b, C[] c, A valueForNoneA, B valueForNoneB, C valueForNoneC, TriFunction<? super A,? super B,? super C,? extends R> zipFunction, Class<R> targetElementType)
    Zips three arrays into a single array using the provided zip function.
    static <A, B, C, R>
    List<R>
    zip(A[] a, B[] b, C[] c, TriFunction<? super A,? super B,? super C,? extends R> zipFunction)
    Zips three arrays into a single list using the provided zip function.
    static <A, B, C, R>
    R[]
    zip(A[] a, B[] b, C[] c, TriFunction<? super A,? super B,? super C,? extends R> zipFunction, Class<R> targetElementType)
    Zips three arrays into a single array using the provided zip function.
    static <A, B, R> List<R>
    zip(A[] a, B[] b, BiFunction<? super A,? super B,? extends R> zipFunction)
    Zips two arrays into a single list using the provided zip function.
    static <A, B, R> R[]
    zip(A[] a, B[] b, BiFunction<? super A,? super B,? extends R> zipFunction, Class<R> targetElementType)
    Zips two arrays into a single array using the provided zip function.
    static <A, B, R> List<R>
    zip(Iterable<A> a, Iterable<B> b, A valueForNoneA, B valueForNoneB, BiFunction<? super A,? super B,? extends R> zipFunction)
    Zips two iterables into a single list using the provided zip function.
    static <A, B, C, R>
    List<R>
    zip(Iterable<A> a, Iterable<B> b, Iterable<C> c, A valueForNoneA, B valueForNoneB, C valueForNoneC, TriFunction<? super A,? super B,? super C,? extends R> zipFunction)
    Zips three iterables into a single list using the provided zip function.
    static <A, B, C, R>
    List<R>
    zip(Iterable<A> a, Iterable<B> b, Iterable<C> c, TriFunction<? super A,? super B,? super C,? extends R> zipFunction)
    Zips three iterables into a single list using the provided zip function.
    static <A, B, R> List<R>
    zip(Iterable<A> a, Iterable<B> b, BiFunction<? super A,? super B,? extends R> zipFunction)
    Zips two iterables into a single list using the provided zip function.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • INDEX_NOT_FOUND

      public static final int INDEX_NOT_FOUND
      The index value when an element is not found in a list or array: -1. This value is returned by methods in this class and can also be used in comparisons with values returned by various method from List .
      See Also:
    • EMPTY_BOOLEAN_ARRAY

      public static final boolean[] EMPTY_BOOLEAN_ARRAY
      An empty immutable/unmodifiable boolean array.
    • EMPTY_CHAR_ARRAY

      public static final char[] EMPTY_CHAR_ARRAY
      An empty immutable/unmodifiable char array.
    • EMPTY_BYTE_ARRAY

      public static final byte[] EMPTY_BYTE_ARRAY
      An empty immutable/unmodifiable byte array.
    • EMPTY_SHORT_ARRAY

      public static final short[] EMPTY_SHORT_ARRAY
      An empty immutable/unmodifiable short array.
    • EMPTY_INT_ARRAY

      public static final int[] EMPTY_INT_ARRAY
      An empty immutable/unmodifiable int array.
    • EMPTY_LONG_ARRAY

      public static final long[] EMPTY_LONG_ARRAY
      An empty immutable/unmodifiable long array.
    • EMPTY_FLOAT_ARRAY

      public static final float[] EMPTY_FLOAT_ARRAY
      An empty immutable/unmodifiable float array.
    • EMPTY_DOUBLE_ARRAY

      public static final double[] EMPTY_DOUBLE_ARRAY
      An empty immutable/unmodifiable double array.
    • EMPTY_BOOLEAN_OBJ_ARRAY

      public static final Boolean[] EMPTY_BOOLEAN_OBJ_ARRAY
      An empty immutable/unmodifiable Boolean array.
    • EMPTY_CHAR_OBJ_ARRAY

      public static final Character[] EMPTY_CHAR_OBJ_ARRAY
      An empty immutable/unmodifiable Character array.
    • EMPTY_BYTE_OBJ_ARRAY

      public static final Byte[] EMPTY_BYTE_OBJ_ARRAY
      An empty immutable/unmodifiable Byte array.
    • EMPTY_SHORT_OBJ_ARRAY

      public static final Short[] EMPTY_SHORT_OBJ_ARRAY
      An empty immutable/unmodifiable Short array.
    • EMPTY_INT_OBJ_ARRAY

      public static final Integer[] EMPTY_INT_OBJ_ARRAY
      An empty immutable/unmodifiable Integer array.
    • EMPTY_LONG_OBJ_ARRAY

      public static final Long[] EMPTY_LONG_OBJ_ARRAY
      An empty immutable/unmodifiable Long array.
    • EMPTY_FLOAT_OBJ_ARRAY

      public static final Float[] EMPTY_FLOAT_OBJ_ARRAY
      An empty immutable/unmodifiable Float array.
    • EMPTY_DOUBLE_OBJ_ARRAY

      public static final Double[] EMPTY_DOUBLE_OBJ_ARRAY
      An empty immutable/unmodifiable Double array.
    • EMPTY_BIG_INTEGER_ARRAY

      public static final BigInteger[] EMPTY_BIG_INTEGER_ARRAY
      An empty immutable/unmodifiable BigInteger array.
    • EMPTY_BIG_DECIMAL_ARRAY

      public static final BigDecimal[] EMPTY_BIG_DECIMAL_ARRAY
      An empty immutable/unmodifiable BigDecimal array.
    • EMPTY_STRING_ARRAY

      public static final String[] EMPTY_STRING_ARRAY
      An empty immutable/unmodifiable String array.
    • EMPTY_JU_DATE_ARRAY

      public static final Date[] EMPTY_JU_DATE_ARRAY
      An empty immutable/unmodifiable java.util.Date array.
    • EMPTY_DATE_ARRAY

      public static final Date[] EMPTY_DATE_ARRAY
      An empty immutable/unmodifiable java.sql.Date array.
    • EMPTY_TIME_ARRAY

      public static final Time[] EMPTY_TIME_ARRAY
      An empty immutable/unmodifiable Time array.
    • EMPTY_TIMESTAMP_ARRAY

      public static final Timestamp[] EMPTY_TIMESTAMP_ARRAY
      An empty immutable/unmodifiable Timestamp array.
    • EMPTY_CALENDAR_ARRAY

      public static final Calendar[] EMPTY_CALENDAR_ARRAY
      /** An empty immutable/unmodifiable Calendar array.
    • EMPTY_LOCAL_DATE_ARRAY

      public static final LocalDate[] EMPTY_LOCAL_DATE_ARRAY
      /** An empty immutable/unmodifiable LocalDate array.
    • EMPTY_LOCAL_TIME_ARRAY

      public static final LocalTime[] EMPTY_LOCAL_TIME_ARRAY
      /** An empty immutable/unmodifiable LocalTime array.
    • EMPTY_LOCAL_DATE_TIME_ARRAY

      public static final LocalDateTime[] EMPTY_LOCAL_DATE_TIME_ARRAY
      /** An empty immutable/unmodifiable LocalDateTime array.
    • EMPTY_OBJECT_ARRAY

      public static final Object[] EMPTY_OBJECT_ARRAY
      An empty immutable/unmodifiable Object array.
  • Method Details

    • occurrencesOf

      public static int occurrencesOf(boolean[] a, boolean valueToFind)
      Counts the occurrences of a specific boolean value in a boolean array.
      Parameters:
      a - The boolean array to be checked for the presence of the valueToFind.
      valueToFind - The boolean value to be checked for its occurrences in the array a.
      Returns:
      The number of occurrences of valueToFind in array a. Returns 0 if the array is null or empty.
    • occurrencesOf

      public static int occurrencesOf(char[] a, char valueToFind)
      Counts the occurrences of a specific char value in a char array.
      Parameters:
      a - The char array to be checked for the presence of the valueToFind.
      valueToFind - The char value to be checked for its occurrences in the array a.
      Returns:
      The number of occurrences of valueToFind in array a. Returns 0 if the array is null or empty.
    • occurrencesOf

      public static int occurrencesOf(byte[] a, byte valueToFind)
      Counts the occurrences of a specific byte value in a byte array.
      Parameters:
      a - The byte array to be checked for the presence of the valueToFind.
      valueToFind - The byte value to be checked for its occurrences in the array a.
      Returns:
      The number of occurrences of valueToFind in array a. Returns 0 if the array is null or empty.
    • occurrencesOf

      public static int occurrencesOf(short[] a, short valueToFind)
      Counts the occurrences of a specific short value in a short array.
      Parameters:
      a - The short array to be checked for the presence of the valueToFind.
      valueToFind - The short value to be checked for its occurrences in the array a.
      Returns:
      The number of occurrences of valueToFind in array a. Returns 0 if the array is null or empty.
    • occurrencesOf

      public static int occurrencesOf(int[] a, int valueToFind)
      Counts the occurrences of a specific int value in a int array.
      Parameters:
      a - The int array to be checked for the presence of the valueToFind.
      valueToFind - The int value to be checked for its occurrences in the array a.
      Returns:
      The number of occurrences of valueToFind in array a. Returns 0 if the array is null or empty.
    • occurrencesOf

      public static int occurrencesOf(long[] a, long valueToFind)
      Counts the occurrences of a specific long value in a long array.
      Parameters:
      a - The long array to be checked for the presence of the valueToFind.
      valueToFind - The long value to be checked for its occurrences in the array a.
      Returns:
      The number of occurrences of valueToFind in array a. Returns 0 if the array is null or empty.
    • occurrencesOf

      public static int occurrencesOf(float[] a, float valueToFind)
      Counts the occurrences of a specific float value in a float array.
      Parameters:
      a - The float array to be checked for the presence of the valueToFind.
      valueToFind - The float value to be checked for its occurrences in the array a.
      Returns:
      The number of occurrences of valueToFind in array a. Returns 0 if the array is null or empty.
    • occurrencesOf

      public static int occurrencesOf(double[] a, double valueToFind)
      Counts the occurrences of a specific double value in a double array.
      Parameters:
      a - The double array to be checked for the presence of the valueToFind.
      valueToFind - The double value to be checked for its occurrences in the array a.
      Returns:
      The number of occurrences of valueToFind in array a. Returns 0 if the array is null or empty.
    • occurrencesOf

      public static int occurrencesOf(Object[] a, Object valueToFind)
      Counts the occurrences of a specific Object value in an Object array.
      Parameters:
      a - The Object array to be checked for the presence of the valueToFind.
      valueToFind - The Object value to be checked for its occurrences in the array a.
      Returns:
      The number of occurrences of valueToFind in array a. Returns 0 if the array is null or empty.
    • occurrencesOf

      public static int occurrencesOf(Iterable<?> c, Object valueToFind)
      Counts the occurrences of a specific Object value in an Iterable.
      Parameters:
      c - The Iterable to be checked for the presence of the valueToFind.
      valueToFind - The Object value to be checked for its occurrences in the Iterable c.
      Returns:
      The number of occurrences of valueToFind in Iterable c. Returns 0 if the Iterable is null.
    • occurrencesOf

      public static int occurrencesOf(Iterator<?> iter, Object valueToFind) throws ArithmeticException
      Counts the occurrences of a specific Object value in an Iterator.
      Parameters:
      iter - The Iterator to be checked for the presence of the valueToFind.
      valueToFind - The Object value to be checked for its occurrences in the Iterator iter.
      Returns:
      The number of occurrences of valueToFind in Iterator iter. Returns 0 if the Iterator is null.
      Throws:
      ArithmeticException - if the number of occurrences exceeds Integer.MAX_VALUE.
      See Also:
    • occurrencesOf

      public static int occurrencesOf(String str, char valueToFind)
      Counts the occurrences of a specific character in a String.
      Parameters:
      str - The String to be checked for the presence of the valueToFind.
      valueToFind - The character to be checked for its occurrences in the String str.
      Returns:
      The number of occurrences of valueToFind in String str. Returns 0 if the String is null or empty.
      See Also:
    • occurrencesOf

      public static int occurrencesOf(String str, String valueToFind)
      Counts the occurrences of a specific String value in another String.
      Parameters:
      str - The String to be checked for the presence of the valueToFind.
      valueToFind - The String value to be checked for its occurrences in the String str.
      Returns:
      The number of occurrences of valueToFind in String str. Returns 0 if the String is null or empty.
      See Also:
    • occurrencesMap

      public static <T> Map<T,Integer> occurrencesMap(T[] a)
      Returns a map with the occurrences of each element in the given array. The map's keys are the distinct elements in the array, and their corresponding values are the number of occurrences of each element. If the input array is null or empty, an empty map is returned.
      Type Parameters:
      T - the type of elements in the input array
      Parameters:
      a - the array to count occurrences from
      Returns:
      a Map containing the elements of the array as keys and their occurrences as values
    • occurrencesMap

      public static <T> Map<T,Integer> occurrencesMap(T[] a, Supplier<Map<T,Integer>> mapSupplier)
      Returns a map with the occurrences of each element in the given array. The map's keys are the distinct elements in the array, and their corresponding values are the number of occurrences of each element. If the input array is null or empty, a map provided by the supplied map supplier is returned.
      Type Parameters:
      T - the type of elements in the input array
      Parameters:
      a - the array to count occurrences from
      mapSupplier - the supplier of the map to be used for collecting occurrences
      Returns:
      a Map containing the elements of the array as keys and their occurrences as values
    • occurrencesMap

      public static <T> Map<T,Integer> occurrencesMap(Iterable<? extends T> c)
      Returns a map with the occurrences of each element in the given iterable collection. The map's keys are the distinct elements in the collection, and their corresponding values are the number of occurrences of each element. If the input collection is null, an empty map is returned.
      Type Parameters:
      T - the type of elements in the input collection
      Parameters:
      c - the collection to count occurrences from
      Returns:
      a Map containing the elements of the collection as keys and their occurrences as values
    • occurrencesMap

      public static <T> Map<T,Integer> occurrencesMap(Iterable<? extends T> c, Supplier<Map<T,Integer>> mapSupplier)
      Returns a map with the occurrences of each element in the given iterable collection. The map's keys are the distinct elements in the collection, and their corresponding values are the number of occurrences of each element. If the input collection is null, a map provided by the supplied map supplier is returned.
      Type Parameters:
      T - the type of elements in the input collection
      Parameters:
      c - the collection to count occurrences from
      mapSupplier - the supplier of the map to be used for collecting occurrences
      Returns:
      a Map containing the elements of the collection as keys and their occurrences as values
    • occurrencesMap

      public static <T> Map<T,Integer> occurrencesMap(Iterator<? extends T> iter)
      Returns a map with the occurrences of each element in the given iterator. The map's keys are the distinct elements in the iterator, and their corresponding values are the number of occurrences of each element. If the input iterator is null or empty, an empty map is returned.
      Type Parameters:
      T - the type of elements in the input iterator
      Parameters:
      iter - the iterator to count occurrences from
      Returns:
      a Map containing the elements of the iterator as keys and their occurrences as values
    • occurrencesMap

      public static <T> Map<T,Integer> occurrencesMap(Iterator<? extends T> iter, Supplier<Map<T,Integer>> mapSupplier)
      Returns a map with the occurrences of each element in the given iterator. The map's keys are the distinct elements in the iterator, and their corresponding values are the number of occurrences of each element. If the input iterator is null or empty, a map provided by the supplied map supplier is returned.
      Type Parameters:
      T - the type of elements in the input iterator
      Parameters:
      iter - the iterator to count occurrences from
      mapSupplier - the supplier of the map to be used for collecting occurrences
      Returns:
      a Map containing the elements of the iterator as keys and their occurrences as values
    • contains

      public static boolean contains(boolean[] a, boolean valueToFind)
      Checks if the specified array contains the specified value.
      Parameters:
      a - The array to be checked for the presence of the value.
      valueToFind - The value to be checked for its presence in the array.
      Returns:
      true if the array contains the specified value, false if a is null or empty or valueToFind is not found.
    • contains

      public static boolean contains(char[] a, char valueToFind)
      Checks if the specified array contains the specified value.
      Parameters:
      a - The array to be checked for the presence of the value.
      valueToFind - The value to be checked for its presence in the array.
      Returns:
      true if the array contains the specified value, false if a is null or empty or valueToFind is not found.
    • contains

      public static boolean contains(byte[] a, byte valueToFind)
      Checks if the specified array contains the specified value.
      Parameters:
      a - The array to be checked for the presence of the value.
      valueToFind - The value to be checked for its presence in the array.
      Returns:
      true if the array contains the specified value, false if a is null or empty or valueToFind is not found.
    • contains

      public static boolean contains(short[] a, short valueToFind)
      Checks if the specified array contains the specified value.
      Parameters:
      a - The array to be checked for the presence of the value.
      valueToFind - The value to be checked for its presence in the array.
      Returns:
      true if the array contains the specified value, false if a is null or empty or valueToFind is not found.
    • contains

      public static boolean contains(int[] a, int valueToFind)
      Checks if the specified array contains the specified value.
      Parameters:
      a - The array to be checked for the presence of the value.
      valueToFind - The value to be checked for its presence in the array.
      Returns:
      true if the array contains the specified value, false if a is null or empty or valueToFind is not found.
    • contains

      public static boolean contains(long[] a, long valueToFind)
      Checks if the specified array contains the specified value.
      Parameters:
      a - The array to be checked for the presence of the value.
      valueToFind - The value to be checked for its presence in the array.
      Returns:
      true if the array contains the specified value, false if a is null or empty or valueToFind is not found.
    • contains

      public static boolean contains(float[] a, float valueToFind)
      Checks if the specified array contains the specified value.
      Parameters:
      a - The array to be checked for the presence of the value.
      valueToFind - The value to be checked for its presence in the array.
      Returns:
      true if the array contains the specified value, false if a is null or empty or valueToFind is not found.
    • contains

      public static boolean contains(double[] a, double valueToFind)
      Checks if the specified array contains the specified value.
      Parameters:
      a - The array to be checked for the presence of the value.
      valueToFind - The value to be checked for its presence in the array.
      Returns:
      true if the array contains the specified value, false if a is null or empty or valueToFind is not found.
    • contains

      public static boolean contains(Object[] a, Object valueToFind)
      Checks if the specified array contains the specified value.
      Parameters:
      a - The array to be checked for the presence of the value.
      valueToFind - The value to be checked for its presence in the array.
      Returns:
      true if the array contains the specified value, false if a is null or empty or valueToFind is not found.
    • contains

      public static boolean contains(Collection<?> c, Object valueToFind)
      Checks if the specified Collection contains the specified value.
      Parameters:
      c - The Collection to be checked for the presence of the Collection.
      valueToFind - The value to be checked for its presence in the array.
      Returns:
      true if the array contains the specified value, false if valueToFind is not found or c is null or empty.
    • contains

      public static boolean contains(Iterable<?> c, Object valueToFind)
      Checks if the specified Iterable contains the specified value.
      Parameters:
      c - The Iterable to be checked for the presence of the value.
      valueToFind - The value to be checked for its presence in the Iterable.
      Returns:
      true if the array contains the specified value, false if valueToFind is not found or c is null or empty.
    • contains

      public static boolean contains(Iterator<?> iter, Object valueToFind)
      Checks if the specified Iterator contains the specified value.
      Parameters:
      valueToFind - The value to be checked for its presence in the Iterator.
      c - The Iterator to be checked for the presence of the value.
      Returns:
      true if the array contains the specified value, false if valueToFind is not found or c is null or empty.
    • containsAll

      public static boolean containsAll(Collection<?> c, Collection<?> valuesToFind)
      Checks if the given Collection contains all the elements in the specified valuesToFind Collection.
      Parameters:
      c - The Collection to be checked for the presence of the elements in valuesToFind.
      valuesToFind - The values to be checked for their presence in the given Collection.
      Returns:
      true if the given Collection contains all the elements in valuesToFind or valuesToFind is null or empty, false otherwise if any element in valuesToFind is not found in the given Collection or the given Collection is null or empty.
    • containsAll

      @SafeVarargs public static boolean containsAll(Collection<?> c, Object... valuesToFind)
      Checks if the given Collection contains all the elements in the specified valuesToFind array.
      Parameters:
      c - The Collection to be checked for the presence of the elements in valuesToFind.
      valuesToFind - The values to be checked for their presence in the given Collection.
      Returns:
      true if the given Collection contains all the elements in valuesToFind or valuesToFind is null or empty, false otherwise if any element in valuesToFind is not found in the given Collection or the given Collection is null or empty.
    • containsAll

      public static boolean containsAll(Iterable<?> c, Collection<?> valuesToFind)
      Checks if the given Iterable contains all the elements in the specified valuesToFind Collection.
      Parameters:
      c - The Iterable to be checked for the presence of the elements in valuesToFind.
      valuesToFind - The values to be checked for their presence in the given Iterable.
      Returns:
      true if the given Iterable contains all the elements in valuesToFind or valuesToFind is null or empty, false otherwise if any element in valuesToFind is not found is not found in the given Iterable or the given Iterable is null or empty.
    • containsAll

      public static boolean containsAll(Iterator<?> iter, Collection<?> valuesToFind)
      Checks if the given Iterator contains all the elements in the specified valuesToFind Collection.
      Parameters:
      valuesToFind - The values to be checked for their presence in the given Iterator.
      c - The Iterator to be checked for the presence of the elements in valuesToFind.
      Returns:
      true if the given Iterator contains all the elements in valuesToFind or valuesToFind is null or empty, false otherwise if any element in valuesToFind is not found in the given Iterator or the given Iterator is null or empty.
    • containsAny

      public static boolean containsAny(Collection<?> c, Collection<?> valuesToFind)
      Checks if the given Collection contains any elements from the specified valuesToFind Collection.
      Parameters:
      c - The Collection to be checked for the presence of any elements in valuesToFind.
      valuesToFind - The values to be checked for their presence in the given Collection.
      Returns:
      true if the given Collection contains any elements in valuesToFind, false otherwise if doesn't or if the given Collection is null or empty, or if the specified valuesToFind is null or empty.
    • containsAny

      @SafeVarargs public static boolean containsAny(Collection<?> c, Object... valuesToFind)
      Checks if the given Collection contains any elements from the specified valuesToFind array.
      Parameters:
      c - The Collection to be checked for the presence of any elements in valuesToFind.
      valuesToFind - The values to be checked for their presence in the {given Collection.
      Returns:
      true if the given Collection contains any elements in valuesToFind, false otherwise if doesn't or if the given Collection is null or empty, or if the specified valuesToFind is null or empty.
    • containsAny

      public static boolean containsAny(Iterable<?> c, Set<?> valuesToFind)
      Checks if the given Iterable contains any elements from the specified valuesToFind Set.
      Parameters:
      c - The Iterable to be checked for the presence of any elements in valuesToFind.
      valuesToFind - The values to be checked for their presence in the given Iterable.
      Returns:
      true if the given Iterable contains any elements in valuesToFind, false otherwise if doesn't or if the given Iterable is null or empty, or if the specified valuesToFind is null or empty.
    • containsAny

      public static boolean containsAny(Iterator<?> iter, Set<?> valuesToFind)
      Checks if the given Iterator contains any elements from the specified valuesToFind Set.
      Parameters:
      iter - The Iterator to be checked for the presence of any elements in valuesToFind.
      valuesToFind - The values to be checked for their presence in the given Iterator.
      Returns:
      true if the given Iterator contains any elements in valuesToFind, false otherwise if doesn't or if the given Iterator is null or empty, or if the specified valuesToFind is null or empty.
    • containsNone

      public static boolean containsNone(Collection<?> c, Collection<?> valuesToFind)
      Checks if the given Collection dosn't contain any elements from the specified valuesToFind Collection.
      Parameters:
      c - The Collection to be checked for the presence of any elements in valuesToFind.
      valuesToFind - The values to be checked for their presence in the given Collection.
      Returns:
      true if the given Collection dosn't contain any elements in valuesToFind or if the given Collection is null or empty, or if the specified valuesToFind is null or empty, false otherwise
    • containsNone

      @SafeVarargs public static boolean containsNone(Collection<?> c, Object... valuesToFind)
      Checks if the specified given Collection dosn't contain any elements from the specified valuesToFind array.
      Parameters:
      c - The Collection to be checked for the presence of any elements in valuesToFind.
      valuesToFind - The values to be checked for their presence in the given Collection.
      Returns:
      true if the given Collection dosn't contain any elements in valuesToFind or if the given Collection is null or empty, or if the specified valuesToFind is null or empty, false otherwise
    • containsNone

      public static boolean containsNone(Iterable<?> c, Set<?> valuesToFind)
      Checks if the given Iterable dosn't contain any elements from the specified valuesToFind Set.
      Parameters:
      c - The Iterable to be checked for the presence of any elements in valuesToFind.
      valuesToFind - The values to be checked for their presence in given Iterable.
      Returns:
      true if the given Iterable dosn't contain any elements in valuesToFind or if the given Iterable is null or empty, or if the specified valuesToFind is null or empty, false otherwise
    • containsNone

      public static boolean containsNone(Iterator<?> iter, Set<?> valuesToFind)
      Checks if the given Iterator dosn't contain any elements from the specified valuesToFind Set.
      Parameters:
      iter - The Iterator to be checked for the presence of any elements in valuesToFind.
      valuesToFind - The values to be checked for their presence in the given Iterator.
      Returns:
      true if the given Iterator dosn't contain any elements in valuesToFind or if the given Iterator is null or empty, or if the specified valuesToFind is null or empty, false otherwise
    • slice

      public static <T> ImmutableList<T> slice(T[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a read-only slice of the input array from the specified start index to the end index.
      Type Parameters:
      T - The type of the elements in the array.
      Parameters:
      a - The input array to be sliced.
      fromIndex - The start index for the slice, inclusive.
      toIndex - The end index for the slice, exclusive.
      Returns:
      An ImmutableList containing the slice of the input array.
      Throws:
      IndexOutOfBoundsException - if the fromIndex is negative, toIndex is larger than the length of the array, or fromIndex is larger than toIndex.
    • slice

      public static <T> ImmutableList<T> slice(List<? extends T> c, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a read-only slice of the input list from the specified start index to the end index.
      Type Parameters:
      T - The type of the elements in the list.
      Parameters:
      c - The input list to be sliced.
      fromIndex - The start index for the slice, inclusive.
      toIndex - The end index for the slice, exclusive.
      Returns:
      An ImmutableList containing the slice of the input list.
      Throws:
      IndexOutOfBoundsException - if the fromIndex is negative, toIndex is larger than the length of the list, or fromIndex is larger than toIndex.
    • slice

      public static <T> ImmutableCollection<T> slice(Collection<? extends T> c, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a read-only slice of the input collection from the specified start index to the end index.
      Type Parameters:
      T - The type of the elements in the collection.
      Parameters:
      c - The input collection to be sliced.
      fromIndex - The start index for the slice, inclusive.
      toIndex - The end index for the slice, exclusive.
      Returns:
      An ImmutableCollection containing the slice of the input collection.
      Throws:
      IndexOutOfBoundsException - if the fromIndex is negative, toIndex is larger than the size of the collection, or fromIndex is larger than toIndex.
    • slice

      public static <T> ObjIterator<T> slice(Iterator<? extends T> iter, int fromIndex, int toIndex)
      Returns a read-only slice of the input iterator from the specified start index to the end index.
      Type Parameters:
      T - The type of the elements in the iterator.
      Parameters:
      iter - The input iterator to be sliced.
      fromIndex - The start index for the slice, inclusive.
      toIndex - The end index for the slice, exclusive.
      Returns:
      An ObjIterator containing the slice of the input iterator.
      Throws:
      IllegalArgumentException - if the fromIndex is negative, or fromIndex is larger than toIndex.
      See Also:
    • split

      public static List<boolean[]> split(boolean[] a, int chunkSize) throws IllegalArgumentException
      Splits the input boolean array into sub-arrays of the specified size. The last sub-array may be smaller if the total array length is not a multiple of chunkSize.
      Parameters:
      a - The input boolean array to be split.
      chunkSize - The desired size of each sub-array.
      Returns:
      A list of boolean sub-arrays, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
    • split

      public static List<boolean[]> split(boolean[] a, int fromIndex, int toIndex, int chunkSize) throws IllegalArgumentException, IndexOutOfBoundsException
      Splits the input boolean array into sub-arrays of the specified size. The last sub-array may be smaller if the length of specified range is not a multiple of chunkSize. The sub-arrays are created from the specified range in the input array.
      Parameters:
      a - The input boolean array to be split.
      fromIndex - The start index for the slice of the array to be split, inclusive.
      toIndex - The end index for the slice of the array to be split, exclusive.
      chunkSize - The desired size of each sub-array.
      Returns:
      A list of boolean sub-arrays, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
      IndexOutOfBoundsException - if fromIndex is negative or larger than toIndex, toIndex is larger than the length of array
    • split

      public static List<char[]> split(char[] a, int chunkSize) throws IllegalArgumentException
      Splits the input char array into sub-arrays of the specified size. The last sub-array may be smaller if the total array length is not a multiple of chunkSize.
      Parameters:
      a - The input char array to be split.
      chunkSize - The desired size of each sub-array.
      Returns:
      A list of char sub-arrays, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
    • split

      public static List<char[]> split(char[] a, int fromIndex, int toIndex, int chunkSize) throws IllegalArgumentException, IndexOutOfBoundsException
      Splits the input char array into sub-arrays of the specified size. The last sub-array may be smaller if the length of specified range is not a multiple of chunkSize. The sub-arrays are created from the specified range in the input array.
      Parameters:
      a - The input char array to be split.
      fromIndex - The start index for the slice of the array to be split, inclusive.
      toIndex - The end index for the slice of the array to be split, exclusive.
      chunkSize - The desired size of each sub-array.
      Returns:
      A list of char sub-arrays, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
      IndexOutOfBoundsException - if fromIndex is negative or larger than toIndex, toIndex is larger than the length of array
    • split

      public static List<byte[]> split(byte[] a, int chunkSize) throws IllegalArgumentException
      Splits the input byte array into sub-arrays of the specified size. The last sub-array may be smaller if the total array length is not a multiple of chunkSize.
      Parameters:
      a - The input byte array to be split.
      chunkSize - The desired size of each sub-array.
      Returns:
      A list of byte sub-arrays, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
    • split

      public static List<byte[]> split(byte[] a, int fromIndex, int toIndex, int chunkSize) throws IllegalArgumentException, IndexOutOfBoundsException
      Splits the input byte array into sub-arrays of the specified size. The last sub-array may be smaller if the length of specified range is not a multiple of chunkSize. The sub-arrays are created from the specified range in the input array.
      Parameters:
      a - The input byte array to be split.
      fromIndex - The start index for the slice of the array to be split, inclusive.
      toIndex - The end index for the slice of the array to be split, exclusive.
      chunkSize - The desired size of each sub-array.
      Returns:
      A list of byte sub-arrays, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
      IndexOutOfBoundsException - if fromIndex is negative or larger than toIndex, toIndex is larger than the length of array
    • split

      public static List<short[]> split(short[] a, int chunkSize) throws IllegalArgumentException
      Splits the input short array into sub-arrays of the specified size. The last sub-array may be smaller if the total array length is not a multiple of chunkSize.
      Parameters:
      a - The input short array to be split.
      chunkSize - The desired size of each sub-array.
      Returns:
      A list of short sub-arrays, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
    • split

      public static List<short[]> split(short[] a, int fromIndex, int toIndex, int chunkSize) throws IllegalArgumentException, IndexOutOfBoundsException
      Splits the input short array into sub-arrays of the specified size. The last sub-array may be smaller if the length of specified range is not a multiple of chunkSize. The sub-arrays are created from the specified range in the input array.
      Parameters:
      a - The input short array to be split.
      fromIndex - The start index for the slice of the array to be split, inclusive.
      toIndex - The end index for the slice of the array to be split, exclusive.
      chunkSize - The desired size of each sub-array.
      Returns:
      A list of short sub-arrays, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
      IndexOutOfBoundsException - if fromIndex is negative or larger than toIndex, toIndex is larger than the length of array
    • split

      public static List<int[]> split(int[] a, int chunkSize) throws IllegalArgumentException
      Splits the input int array into sub-arrays of the specified size. The last sub-array may be smaller if the total array length is not a multiple of chunkSize.
      Parameters:
      a - The input int array to be split.
      chunkSize - The desired size of each sub-array.
      Returns:
      A list of int sub-arrays, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
    • split

      public static List<int[]> split(int[] a, int fromIndex, int toIndex, int chunkSize) throws IllegalArgumentException, IndexOutOfBoundsException
      Splits the input int array into sub-arrays of the specified size. The last sub-array may be smaller if the length of specified range is not a multiple of chunkSize. The sub-arrays are created from the specified range in the input array.
      Parameters:
      a - The input int array to be split.
      fromIndex - The start index for the slice of the array to be split, inclusive.
      toIndex - The end index for the slice of the array to be split, exclusive.
      chunkSize - The desired size of each sub-array.
      Returns:
      A list of int sub-arrays, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
      IndexOutOfBoundsException - if fromIndex is negative or larger than toIndex, toIndex is larger than the length of array
    • split

      public static List<long[]> split(long[] a, int chunkSize) throws IllegalArgumentException
      Splits the input long array into sub-arrays of the specified size. The last sub-array may be smaller if the total array length is not a multiple of chunkSize.
      Parameters:
      a - The input long array to be split.
      chunkSize - The desired size of each sub-array.
      Returns:
      A list of long sub-arrays, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
    • split

      public static List<long[]> split(long[] a, int fromIndex, int toIndex, int chunkSize) throws IllegalArgumentException, IndexOutOfBoundsException
      Splits the input long array into sub-arrays of the specified size. The last sub-array may be smaller if the length of specified range is not a multiple of chunkSize. The sub-arrays are created from the specified range in the input array.
      Parameters:
      a - The input long array to be split.
      fromIndex - The start index for the slice of the array to be split, inclusive.
      toIndex - The end index for the slice of the array to be split, exclusive.
      chunkSize - The desired size of each sub-array.
      Returns:
      A list of long sub-arrays, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
      IndexOutOfBoundsException - if fromIndex is negative or larger than toIndex, toIndex is larger than the length of array
    • split

      public static List<float[]> split(float[] a, int chunkSize) throws IllegalArgumentException
      Splits the input float array into sub-arrays of the specified size. The last sub-array may be smaller if the total array length is not a multiple of chunkSize.
      Parameters:
      a - The input float array to be split.
      chunkSize - The desired size of each sub-array.
      Returns:
      A list of float sub-arrays, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
    • split

      public static List<float[]> split(float[] a, int fromIndex, int toIndex, int chunkSize) throws IllegalArgumentException, IndexOutOfBoundsException
      Splits the input float array into sub-arrays of the specified size. The last sub-array may be smaller if the length of specified range is not a multiple of chunkSize. The sub-arrays are created from the specified range in the input array.
      Parameters:
      a - The input float array to be split.
      fromIndex - The start index for the slice of the array to be split, inclusive.
      toIndex - The end index for the slice of the array to be split, exclusive.
      chunkSize - The desired size of each sub-array.
      Returns:
      A list of float sub-arrays, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
      IndexOutOfBoundsException - if fromIndex is negative or larger than toIndex, toIndex is larger than the length of array
    • split

      public static List<double[]> split(double[] a, int chunkSize) throws IllegalArgumentException
      Splits the input double array into sub-arrays of the specified size. The last sub-array may be smaller if the total array length is not a multiple of chunkSize.
      Parameters:
      a - The input double array to be split.
      chunkSize - The desired size of each sub-array.
      Returns:
      A list of double sub-arrays, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
    • split

      public static List<double[]> split(double[] a, int fromIndex, int toIndex, int chunkSize) throws IllegalArgumentException, IndexOutOfBoundsException
      Splits the input double array into sub-arrays of the specified size. The last sub-array may be smaller if the length of specified range is not a multiple of chunkSize. The sub-arrays are created from the specified range in the input array.
      Parameters:
      a - The input double array to be split.
      fromIndex - The start index for the slice of the array to be split, inclusive.
      toIndex - The end index for the slice of the array to be split, exclusive.
      chunkSize - The desired size of each sub-array.
      Returns:
      A list of double sub-arrays, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
      IndexOutOfBoundsException - if fromIndex is negative or larger than toIndex, toIndex is larger than the length of array
    • split

      public static <T> List<T[]> split(T[] a, int chunkSize) throws IllegalArgumentException
      Splits the input array into sub-arrays of the specified size. The last sub-array may be smaller if the total array length is not a multiple of chunkSize.
      Type Parameters:
      T - The type of the elements in the array.
      Parameters:
      a - The input array to be split.
      chunkSize - The desired size of each sub-array.
      Returns:
      A list of sub-arrays, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
    • split

      public static <T> List<T[]> split(T[] a, int fromIndex, int toIndex, int chunkSize) throws IllegalArgumentException, IndexOutOfBoundsException
      Splits the input array into sub-arrays of the specified size. The last sub-array may be smaller if the length of specified range is not a multiple of chunkSize. The sub-arrays are created from the specified range in the input array.
      Parameters:
      a - The input array to be split.
      fromIndex - The start index for the slice of the array to be split, inclusive.
      toIndex - The end index for the slice of the array to be split, exclusive.
      chunkSize - The desired size of each sub-array.
      Returns:
      A list of sub-arrays, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
      IndexOutOfBoundsException - if fromIndex is negative or larger than toIndex, toIndex is larger than the length of array
    • split

      public static <T> List<List<T>> split(Collection<? extends T> c, int chunkSize) throws IllegalArgumentException
      Splits the input collection into sub-collections of the specified size. The last sub-collection may be smaller if the total collection size is not a multiple of chunkSize.
      Type Parameters:
      T - The type of the elements in the collection.
      Parameters:
      c - The input collection to be split.
      chunkSize - The desired size of each sub-collection.
      Returns:
      A list of sub-collections, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
    • split

      public static <T> List<List<T>> split(Collection<? extends T> c, int fromIndex, int toIndex, int chunkSize) throws IllegalArgumentException, IndexOutOfBoundsException
      Splits the input collection into sub-collections of the specified size. The last sub-collection may be smaller if the length of specified range is not a multiple of chunkSize. The sub-collections are created from the specified range in the input collection.
      Type Parameters:
      T - The type of the elements in the collection.
      Parameters:
      c - The input collection to be split.
      fromIndex - The start index for the slice of the collection to be split, inclusive.
      toIndex - The end index for the slice of the collection to be split, exclusive.
      chunkSize - The desired size of each sub-collection.
      Returns:
      A list of sub-collections, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
      IndexOutOfBoundsException - if fromIndex is negative or larger than toIndex, or toIndex is greater than the size of collection.
    • split

      public static <T> List<List<T>> split(Iterable<? extends T> c, int chunkSize) throws IllegalArgumentException
      Splits the input iterable into sub-collections of the specified size. The last sub-collection may be smaller if the total iterable size is not a multiple of chunkSize.
      Type Parameters:
      T - The type of the elements in the iterable.
      Parameters:
      c - The input iterable to be split.
      chunkSize - The desired size of each sub-collection.
      Returns:
      A list of sub-collections, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
    • split

      public static <T> ObjIterator<List<T>> split(Iterator<? extends T> iter, int chunkSize) throws IllegalArgumentException
      Splits the input iterator into sub-collections of the specified size. The last sub-collection may be smaller if the total iterator size is not a multiple of chunkSize.
      Type Parameters:
      T - The type of the elements in the iterator.
      Parameters:
      iter - The input iterator to be split.
      chunkSize - The desired size of each sub-collection.
      Returns:
      An iterator of sub-collections, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
    • split

      public static List<String> split(CharSequence str, int chunkSize) throws IllegalArgumentException
      Returns consecutive substring of the specified string, each of the same length (the final list may be smaller), or an empty array if the specified string is null or empty.
      Parameters:
      str -
      chunkSize - the desired size of each sub String (the last may be smaller).
      Returns:
      Throws:
      IllegalArgumentException
    • split

      public static List<String> split(CharSequence str, int fromIndex, int toIndex, int chunkSize) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns consecutive substring of the specified string, each of the same length (the final list may be smaller), or an empty array if the specified string is null or empty.
      Parameters:
      str -
      fromIndex -
      toIndex -
      chunkSize - the desired size of each sub String (the last may be smaller).
      Returns:
      Throws:
      IllegalArgumentException
      IndexOutOfBoundsException
    • splitByChunkCount

      public static <T> List<T> splitByChunkCount(int totalSize, int maxChunkCount, IntBiFunction<? extends T> func)
      Splits the total size into chunks based on the specified maximum chunk count.
      The size of the chunks is larger first.
      The size of returned List may be less than the specified maxChunkCount if the input totalSize is less than maxChunkCount.
      Type Parameters:
      T - the type of the elements in the resulting stream
      Parameters:
      totalSize - the total size to be split. It could be the size of an array, list, etc.
      maxChunkCount - the maximum number of chunks to split into
      mapper - a function to map the chunk from and to index to an element in the resulting stream
      Returns:
      a Stream of the mapped chunk values
      Throws:
      IllegalArgumentException - if totalSize is negative or maxChunkCount is not positive.
      See Also:
    • splitByChunkCount

      public static <T> List<T> splitByChunkCount(int totalSize, int maxChunkCount, boolean sizeSmallerFirst, IntBiFunction<? extends T> func)
      Splits the total size into chunks based on the specified maximum chunk count.
      The size of the chunks can be either smaller or larger first based on the flag.
      The size of returned List may be less than the specified maxChunkCount if the input totalSize is less than maxChunkCount.
       
       final int[] a = Array.rangeClosed(1, 7);
       splitByChunkCount(7, 5, true, (fromIndex, toIndex) ->  copyOfRange(a, fromIndex, toIndex)); // [[1], [2], [3], [4, 5], [6, 7]]
       splitByChunkCount(7, 5, false, (fromIndex, toIndex) ->  copyOfRange(a, fromIndex, toIndex)); // [[1, 2], [3, 4], [5], [6], [7]]
       
       
      Type Parameters:
      T - the type of the elements in the resulting stream
      Parameters:
      totalSize - the total size to be split. It could be the size of an array, list, etc.
      maxChunkCount - the maximum number of chunks to split into
      sizeSmallerFirst - if true, smaller chunks will be created first; otherwise, larger chunks will be created first
      mapper - a function to map the chunk from and to index to an element in the resulting stream
      Returns:
      a Stream of the mapped chunk values
      Throws:
      IllegalArgumentException - if totalSize is negative or maxChunkCount is not positive.
      See Also:
    • splitByChunkCount

      public static <T> List<List<T>> splitByChunkCount(Collection<? extends T> c, int maxChunkCount)
      Splits the input collection into sub-lists based on the specified maximum chunk count.
      The size of the chunks is larger first.
      The size of returned List may be less than the specified maxChunkCount if the input Collection size is less than maxChunkCount.
      Type Parameters:
      T - the type of elements in the input collection
      Parameters:
      c - the input collection to be split
      maxChunkCount - the maximum number of chunks to split into
      Returns:
      a list of sub-lists.
      Throws:
      IllegalArgumentException - if maxChunkCount is not positive.
      See Also:
    • splitByChunkCount

      public static <T> List<List<T>> splitByChunkCount(Collection<? extends T> c, int maxChunkCount, boolean sizeSmallerFirst)
      Splits the input collection into sub-lists based on the specified maximum chunk count.
      The size of the chunks can be either smaller or larger first based on the flag.
      The size of returned List may be less than the specified maxChunkCount if the input Collection size is less than maxChunkCount.
       
       final List c = N.asList(1, 2, 3, 4, 5, 6, 7);
       splitByChunkCount(c, 5, true); // [[1], [2], [3], [4, 5], [6, 7]]
       splitByChunkCount(c, 5, false); // [[1, 2], [3, 4], [5], [6], [7]]
       
       
      Type Parameters:
      T - the type of elements in the input collection
      Parameters:
      c - the input collection to be split
      maxChunkCount - the maximum number of chunks to split into
      sizeSmallerFirst - if true, smaller chunks will be created first; otherwise, larger chunks will be created first
      Returns:
      a list of sub-lists.
      Throws:
      IllegalArgumentException - if maxChunkCount is not positive.
      See Also:
    • concat

      public static boolean[] concat(boolean[] a, boolean[] b)
      Concatenates two boolean arrays into a new array.
      Parameters:
      a - The first boolean array.
      b - The second boolean array.
      Returns:
      A new boolean array that contains the elements of a followed by the elements of b. If both a and b are empty or null, an empty array is returned. If a is empty or null, a clone of b is returned. If b is empty or null, a clone of a is returned.
    • concat

      @SafeVarargs public static boolean[] concat(boolean[]... aa)
      Concatenates multiple boolean arrays into a new array.
      Parameters:
      aa - The boolean arrays to be concatenated.
      Returns:
      A new boolean array that contains the elements of each array in 'aa' in the same order. If 'aa' is empty or null, an empty array is returned. If 'aa' contains only one array, a clone of this array is returned.
    • concat

      public static char[] concat(char[] a, char[] b)
      Concatenates two char arrays into a new array.
      Parameters:
      a - The first char array.
      b - The second char array.
      Returns:
      A new char array that contains the elements of a followed by the elements of b. If both a and b are empty or null, an empty array is returned. If a is empty or null, a clone of b is returned. If b is empty or null, a clone of a is returned.
    • concat

      @SafeVarargs public static char[] concat(char[]... aa)
      Concatenates multiple char arrays into a new array.
      Parameters:
      aa - The char arrays to be concatenated.
      Returns:
      A new char array that contains the elements of each array in 'aa' in the same order. If 'aa' is empty or null, an empty array is returned. If 'aa' contains only one array, a clone of this array is returned.
    • concat

      public static byte[] concat(byte[] a, byte[] b)
      Concatenates two byte arrays into a new array.
      Parameters:
      a - The first byte array.
      b - The second byte array.
      Returns:
      A new byte array that contains the elements of a followed by the elements of b. If both a and b are empty or null, an empty array is returned. If a is empty or null, a clone of b is returned. If b is empty or null, a clone of a is returned.
    • concat

      @SafeVarargs public static byte[] concat(byte[]... aa)
      Concatenates multiple byte arrays into a new array.
      Parameters:
      aa - The byte arrays to be concatenated.
      Returns:
      A new byte array that contains the elements of each array in 'aa' in the same order. If 'aa' is empty or null, an empty array is returned. If 'aa' contains only one array, a clone of this array is returned.
    • concat

      public static short[] concat(short[] a, short[] b)
      Concatenates two short arrays into a new array.
      Parameters:
      a - The first short array.
      b - The second short array.
      Returns:
      A new short array that contains the elements of a followed by the elements of b. If both a and b are empty or null, an empty array is returned. If a is empty or null, a clone of b is returned. If b is empty or null, a clone of a is returned.
    • concat

      @SafeVarargs public static short[] concat(short[]... aa)
      Concatenates multiple short arrays into a new array.
      Parameters:
      aa - The short arrays to be concatenated.
      Returns:
      A new short array that contains the elements of each array in 'aa' in the same order. If 'aa' is empty or null, an empty array is returned. If 'aa' contains only one array, a clone of this array is returned.
    • concat

      public static int[] concat(int[] a, int[] b)
      Concatenates two int arrays into a new array.
      Parameters:
      a - The first int array.
      b - The second int array.
      Returns:
      A new int array that contains the elements of a followed by the elements of b. If both a and b are empty or null, an empty array is returned. If a is empty or null, a clone of b is returned. If b is empty or null, a clone of a is returned.
    • concat

      @SafeVarargs public static int[] concat(int[]... aa)
      Concatenates multiple int arrays into a new array.
      Parameters:
      aa - The int arrays to be concatenated.
      Returns:
      A new int array that contains the elements of each array in 'aa' in the same order. If 'aa' is empty or null, an empty array is returned. If 'aa' contains only one array, a clone of this array is returned.
    • concat

      public static long[] concat(long[] a, long[] b)
      Concatenates two long arrays into a new array.
      Parameters:
      a - The first long array.
      b - The second long array.
      Returns:
      A new long array that contains the elements of a followed by the elements of b. If both a and b are empty or null, an empty array is returned. If a is empty or null, a clone of b is returned. If b is empty or null, a clone of a is returned.
    • concat

      @SafeVarargs public static long[] concat(long[]... aa)
      Concatenates multiple long arrays into a new array.
      Parameters:
      aa - The long arrays to be concatenated.
      Returns:
      A new long array that contains the elements of each array in 'aa' in the same order. If 'aa' is empty or null, an empty array is returned. If 'aa' contains only one array, a clone of this array is returned.
    • concat

      public static float[] concat(float[] a, float[] b)
      Concatenates two float arrays into a new array.
      Parameters:
      a - The first float array.
      b - The second float array.
      Returns:
      A new float array that contains the elements of a followed by the elements of b. If both a and b are empty or null, an empty array is returned. If a is empty or null, a clone of b is returned. If b is empty or null, a clone of a is returned.
    • concat

      @SafeVarargs public static float[] concat(float[]... aa)
      Concatenates multiple float arrays into a new array.
      Parameters:
      aa - The float arrays to be concatenated.
      Returns:
      A new float array that contains the elements of each array in 'aa' in the same order. If 'aa' is empty or null, an empty array is returned. If 'aa' contains only one array, a clone of this array is returned.
    • concat

      public static double[] concat(double[] a, double[] b)
      Concatenates two double arrays into a new array.
      Parameters:
      a - The first double array.
      b - The second double array.
      Returns:
      A new double array that contains the elements of a followed by the elements of b. If both a and b are empty or null, an empty array is returned. If a is empty or null, a clone of b is returned. If b is empty or null, a clone of a is returned.
    • concat

      @SafeVarargs public static double[] concat(double[]... aa)
      Concatenates multiple double arrays into a new array.
      Parameters:
      aa - The double arrays to be concatenated.
      Returns:
      A new double array that contains the elements of each array in 'aa' in the same order. If 'aa' is empty or null, an empty array is returned. If 'aa' contains only one array, a clone of this array is returned.
    • concat

      public static <T> T[] concat(T[] a, T[] b)
      Concatenates two arrays into a new array.
      Type Parameters:
      T - The type of the elements in the arrays.
      Parameters:
      a - The first array.
      b - The second array.
      Returns:
      A new array that contains the elements of a followed by the elements of b. If both a and b are empty or null, a is returned. If a is empty or null, a clone of b is returned. If b is empty or null, a clone of a is returned.
      See Also:
    • concat

      @MayReturnNull @SafeVarargs public static <T> T[] concat(T[]... aa)
      Concatenates multiple arrays into a new array.
      Type Parameters:
      T - The type of the elements in the arrays.
      Parameters:
      aa - The arrays to be concatenated.
      Returns:
      A new array that contains the elements of each array in 'aa' in the same order. If all of the specified arrays are null, null is returned.
      See Also:
    • concat

      public static <T> List<T> concat(Iterable<? extends T> a, Iterable<? extends T> b)
      Concatenates two iterables into a new list.
      Type Parameters:
      T - The type of the elements in the iterables.
      Parameters:
      a - The first iterable.
      b - The second iterable.
      Returns:
      A new list that contains the elements of a followed by the elements of b. If both a and b are empty or null, an empty list is returned. If a is empty or null, a list containing the elements of b is returned. If b is empty or null, a list containing the elements of a is returned.
      See Also:
    • concat

      @SafeVarargs public static <T> List<T> concat(Iterable<? extends T>... a)
      Concatenates multiple iterables into a new list.
      Type Parameters:
      T - The type of the elements in the iterables.
      Parameters:
      a - The iterables to be concatenated.
      Returns:
      A new list that contains the elements of each iterable in a in the same order. If a is empty or null, an empty list is returned. If a contains only one iterable, a list containing the elements of this iterable is returned.
      See Also:
    • concat

      public static <T> List<T> concat(Collection<? extends Iterable<? extends T>> c)
      Concatenates multiple iterables into a new list.
      Type Parameters:
      T - The type of the elements in the iterables.
      Parameters:
      c - The collection of iterable to be concatenated.
      Returns:
      A new list that contains the elements of each iterable in c in the same order. If c is empty or null, an empty list is returned. If c contains only one iterable, a list containing the elements of this iterable is returned.
      See Also:
    • concat

      public static <T, C extends Collection<T>> C concat(Collection<? extends Iterable<? extends T>> c, IntFunction<? extends C> supplier)
      Concatenates multiple iterables into a new collection.
      Type Parameters:
      T - The type of the elements in the iterables.
      C - The type of the collection to be returned.
      Parameters:
      c - The collection of iterable to be concatenated.
      supplier - The function that generates a new instance of the return collection.
      Returns:
      A new collection that contains the elements of each iterable in c in the same order. The type of the returned collection is determined by the supplier function. If c is empty or null, an empty collection is returned. If c contains only one iterable, a collection containing the elements of this iterable is returned.
      See Also:
    • concat

      public static <T> ObjIterator<T> concat(Iterator<? extends T> a, Iterator<? extends T> b)
      Concatenates two iterators into a new ObjIterator.
      Type Parameters:
      T - The type of the elements in the iterators.
      Parameters:
      a - The first iterator.
      b - The second iterator.
      Returns:
      A new ObjIterator that contains the elements of a followed by the elements of b.
      See Also:
    • concat

      @SafeVarargs public static <T> ObjIterator<T> concat(Iterator<? extends T>... a)
      Concatenates multiple iterators into a new ObjIterator.
      Type Parameters:
      T - The type of the elements in the iterators.
      Parameters:
      a - The array of iterators to be concatenated.
      Returns:
      A new ObjIterator that contains the elements of each iterator in a in the same order.
      See Also:
    • flatten

      public static boolean[] flatten(boolean[][] a)
      Flattens a two-dimensional boolean array into a one-dimensional boolean array.
      Parameters:
      a - The two-dimensional boolean array to be flattened.
      Returns:
      A one-dimensional boolean array containing all elements in the input array. Returns an empty array if the input array is null or empty.
    • flatten

      public static char[] flatten(char[][] a)
      Flattens a two-dimensional char array into a one-dimensional char array.
      Parameters:
      a - The two-dimensional char array to be flattened.
      Returns:
      A one-dimensional char array containing all elements in the input array. Returns an empty array if the input array is null or empty.
    • flatten

      public static byte[] flatten(byte[][] a)
      Flattens a two-dimensional byte array into a one-dimensional byte array.
      Parameters:
      a - The two-dimensional byte array to be flattened.
      Returns:
      A one-dimensional byte array containing all elements in the input array. Returns an empty array if the input array is null or empty.
    • flatten

      public static short[] flatten(short[][] a)
      Flattens a two-dimensional short array into a one-dimensional short array.
      Parameters:
      a - The two-dimensional short array to be flattened.
      Returns:
      A one-dimensional short array containing all elements in the input array. Returns an empty array if the input array is null or empty.
    • flatten

      public static int[] flatten(int[][] a)
      Flattens a two-dimensional int array into a one-dimensional int array.
      Parameters:
      a - The two-dimensional int array to be flattened.
      Returns:
      A one-dimensional int array containing all elements in the input array. Returns an empty array if the input array is null or empty.
    • flatten

      public static long[] flatten(long[][] a)
      Flattens a two-dimensional long array into a one-dimensional long array.
      Parameters:
      a - The two-dimensional long array to be flattened.
      Returns:
      A one-dimensional long array containing all elements in the input array. Returns an empty array if the input array is null or empty.
    • flatten

      public static float[] flatten(float[][] a)
      Flattens a two-dimensional float array into a one-dimensional float array.
      Parameters:
      a - The two-dimensional float array to be flattened.
      Returns:
      A one-dimensional float array containing all elements in the input array. Returns an empty array if the input array is null or empty.
    • flatten

      public static double[] flatten(double[][] a)
      Flattens a two-dimensional double array into a one-dimensional double array.
      Parameters:
      a - The two-dimensional double array to be flattened.
      Returns:
      A one-dimensional double array containing all elements in the input array. Returns an empty array if the input array is null or empty.
    • flatten

      @MayReturnNull public static <T> T[] flatten(T[][] a)
      Flattens a two-dimensional array into a one-dimensional array.
      Type Parameters:
      T - The type of the elements in the array.
      Parameters:
      a - The two-dimensional array to be flattened.
      Returns:
      A one-dimensional array containing all elements in the input array. Returns null if the input array is null.
    • flatten

      public static <T> T[] flatten(T[][] a, Class<T> componentType)
      Flattens a two-dimensional array into a one-dimensional array.
      Type Parameters:
      T - The type of the elements in the array.
      Parameters:
      a - The two-dimensional array to be flattened.
      componentType - The class object representing the component type of the new array.
      Returns:
      A one-dimensional array containing all elements in the input array. Returns an empty array if the input array is null.
    • flatten

      public static <T> List<T> flatten(Iterable<? extends Iterable<? extends T>> c)
      Flattens an Iterable of Iterable<T> into a one-dimensional List.
      Type Parameters:
      T - The type of the elements in the Iterable.
      Parameters:
      c - The two-dimensional Iterable to be flattened.
      Returns:
      A one-dimensional List containing all elements in the input Iterable. Returns an empty List if the input Iterable is null or empty.
    • flatten

      public static <T, C extends Collection<T>> C flatten(Iterable<? extends Iterable<? extends T>> c, IntFunction<? extends C> supplier)
      Flattens an Iterable of Iterable<T> into a one-dimensional Collection.
      Type Parameters:
      T - The type of the elements in the Iterable.
      C - The type of the Collection to be returned.
      Parameters:
      c - The two-dimensional Iterable to be flattened.
      supplier - The function that generates the Collection instance.
      Returns:
      A one-dimensional Collection containing all elements in the input Iterable. Returns an empty Collection if the input Iterable is null or empty.
    • flatten

      public static <T> ObjIterator<T> flatten(Iterator<? extends Iterator<? extends T>> iters)
      Flattens an Iterator of Iterator<T> into a one-dimensional Iterator.
      Type Parameters:
      T - The type of the elements in the Iterator.
      Parameters:
      iters - The two-dimensional Iterator to be flattened.
      Returns:
      A one-dimensional Iterator containing all elements in the input Iterator. Returns an empty Iterator if the input Iterator is null.
    • flattenEachElement

      @Beta public static List<?> flattenEachElement(Iterable<?> c)
      Flattens each element of the provided Iterable if it's an Iterable itself, otherwise just adds it to the result List. This method is marked as Beta and may be subject to changes or removal in future versions.
      Parameters:
      c - The Iterable to be processed. Each element is checked if it's an Iterable and flattened if so.
      Returns:
      A List containing the flattened elements of the input Iterable. If the input Iterable is null, an empty List is returned.
    • flattenEachElement

      @Beta public static <T, C extends Collection<T>> C flattenEachElement(Iterable<?> c, Supplier<? extends C> supplier)
      Flattens each element of the provided Iterable if it's an Iterable itself, otherwise just adds it to the result Collection. This method is marked as Beta and may be subject to changes or removal in future versions.
      Type Parameters:
      T - The type of the elements in the Iterable.
      C - The type of the Collection to be returned.
      Parameters:
      c - The Iterable to be processed. Each element is checked if it's an Iterable and flattened if so.
      supplier - The function that generates the Collection instance.
      Returns:
      A Collection containing the flattened elements of the input Iterable. If the input Iterable is null, an empty Collection is returned.
    • intersection

      public static boolean[] intersection(boolean[] a, boolean[] b)
      Returns the elements in the specified boolean arrays a and b that are present in both arrays. Occurrences are considered.
      Parameters:
      a - The first boolean array.
      b - The second boolean array.
      Returns:
      A new boolean array containing the elements that are present in both a and b. If either a or b is empty or null, an empty array is returned.
      See Also:
    • intersection

      public static char[] intersection(char[] a, char[] b)
      Returns the elements in the specified char arrays a and b that are present in both arrays. Occurrences are considered.
      Parameters:
      a - The first char array.
      b - The second char array.
      Returns:
      A new char array containing the elements that are present in both a and b. If either a or b is empty or null, an empty array is returned.
      See Also:
    • intersection

      public static byte[] intersection(byte[] a, byte[] b)
      Returns the elements in the specified byte arrays a and b that are present in both arrays. Occurrences are considered.
      Parameters:
      a - The first byte array.
      b - The second byte array.
      Returns:
      A new byte array containing the elements that are present in both a and b. If either a or b is empty or null, an empty array is returned.
      See Also:
    • intersection

      public static short[] intersection(short[] a, short[] b)
      Returns the elements in the specified short arrays a and b that are present in both arrays. Occurrences are considered.
      Parameters:
      a - The first short array.
      b - The second short array.
      Returns:
      A new short array containing the elements that are present in both a and b. If either a or b is empty or null, an empty array is returned.
      See Also:
    • intersection

      public static int[] intersection(int[] a, int[] b)
      Returns the elements in the specified int arrays a and b that are present in both arrays. Occurrences are considered.
       int[] a = {0, 1, 2, 2, 3};
       int[] b = {2, 5, 1};
       int[] c = retainAll(a, b); // The elements c in a will b: [1, 2, 2].
      
       int[] a = {0, 1, 2, 2, 3};
       int[] b = {2, 5, 1};
       int[] c = intersection(a, b); // The elements c in a will b: [1, 2].
       
      Parameters:
      a - The first int array.
      b - The second int array.
      Returns:
      A new int array containing the elements that are present in both a and b. If either a or b is empty or null, an empty array is returned.
    • intersection

      public static long[] intersection(long[] a, long[] b)
      Returns the elements in the specified long arrays a and b that are present in both arrays. Occurrences are considered.
      Parameters:
      a - The first long array.
      b - The second long array.
      Returns:
      A new long array containing the elements that are present in both a and b. If either a or b is empty or null, an empty array is returned.
      See Also:
    • intersection

      public static float[] intersection(float[] a, float[] b)
      Returns the elements in the specified float arrays a and b that are present in both arrays. Occurrences are considered.
      Parameters:
      a - The first float array.
      b - The second float array.
      Returns:
      A new float array containing the elements that are present in both a and b. If either a or b is empty or null, an empty array is returned.
      See Also:
    • intersection

      public static double[] intersection(double[] a, double[] b)
      Returns the elements in the specified double arrays a and b that are present in both arrays. Occurrences are considered.
      Parameters:
      a - The first double array.
      b - The second double array.
      Returns:
      A new double array containing the elements that are present in both a and b. If either a or b is empty or null, an empty array is returned.
      See Also:
    • intersection

      public static <T> List<T> intersection(T[] a, Object[] b)
      Returns the elements in the specified arrays a and b that are present in both arrays. Occurrences are considered.
      Type Parameters:
      T - The type of the elements in the input array.
      Parameters:
      a - The first array.
      b - The second array.
      Returns:
      A new list containing the elements that are present in both a and b. If either a or b is empty or null, an empty list is returned.
      See Also:
    • intersection

      public static <T> List<T> intersection(Collection<? extends T> a, Collection<?> b)
      Returns the elements in the specified collections a and b that are present in both collections. Occurrences are considered.
      Type Parameters:
      T - the type of elements in the input collections
      Parameters:
      a - the first collection
      b - the second collection
      Returns:
      a list containing the elements that are present in both collections If either a or b is empty or null, an empty list is returned.
      See Also:
    • intersection

      public static <T> List<T> intersection(Collection<? extends Collection<? extends T>> c)
      Returns the elements that are present in all collections within the specified collection of collections. Occurrences are considered.
      Type Parameters:
      T - The type of the elements in the collections.
      Parameters:
      c - The collection of collections to find the intersection of.
      Returns:
      A list containing the elements that are present in all collections within c. If c is empty or null, an empty list is returned. If c contains only one collection, a list containing the elements of this collection is returned.
      See Also:
    • intersection

      @Beta public static <T> List<T> intersection(Collection<? extends T> a, Collection<?> b, boolean ignoreOcurrences)
      Return only the elements in the first collection that are contained in the specified second collection.
      If ignoreOcurrences is true, Occurrences are not considered.
      Duplicated elements in the returned List will not be eliminated.
       List a = N.asList(0, 1, 2, 2, 3);
       List b = N.asList(2, 5, 1);
       List c = N.intersection(a, b, false); // The elements c in a will b: [1, 2]. same as N.intersection(a, b).
       List d = N.intersection(a, b, true); // The elements c in a will b: [1, 2, 2].
       
      Type Parameters:
      T - the type of elements in the input collections
      Parameters:
      a - the first collection, elements from this collection will be retained
      b - the second collection, elements in this collection are to be retained in the first collection
      ignoreOcurrences - if true, the method does not consider the number of occurrences of an element.
      Returns:
      a List the elements in the first collection that are contained in the specified second collection.
      See Also:
    • difference

      public static boolean[] difference(boolean[] a, boolean[] b)
      Returns the elements in the specified boolean array a but not present in the boolean array b. Occurrences are considered.
      Parameters:
      a - The first boolean array.
      b - The second boolean array.
      Returns:
      A new boolean array containing the elements that are present in a but not in b. If a is empty or null, an empty array is returned. If b is empty or null, a clone of a is returned.
      See Also:
    • difference

      public static char[] difference(char[] a, char[] b)
      Returns the elements in the specified char array a but not present in the char array b. Occurrences are considered.
      Parameters:
      a - The first char array.
      b - The second char array.
      Returns:
      A new char array containing the elements that are present in a but not in b. If a is empty or null, an empty array is returned. If b is empty or null, a clone of a is returned
      See Also:
    • difference

      public static byte[] difference(byte[] a, byte[] b)
      Returns the elements in the specified byte array a but not present in the byte array b. Occurrences are considered.
      Parameters:
      a - The first byte array.
      b - The second byte array.
      Returns:
      A new byte array containing the elements that are present in a but not in b. If a is empty or null, an empty array is returned. If b is empty or null, a clone of a is returned
      See Also:
    • difference

      public static short[] difference(short[] a, short[] b)
      Returns the elements in the specified short array a but not present in the short array b. Occurrences are considered.
      Parameters:
      a - The first short array.
      b - The second short array.
      Returns:
      A new short array containing the elements that are present in a but not in b. If a is empty or null, an empty array is returned. If b is empty or null, a clone of a is returned
      See Also:
    • difference

      public static int[] difference(int[] a, int[] b)
      Returns the elements in the specified int array a but not present in the int array b. Occurrences are considered.
       int[] a = {0, 1, 2, 2, 3};
       int[] b = {2, 5, 1};
       int[] c = removeAll(a, b); // The elements c in a will b: [0, 3].
      
       int[] a = {0, 1, 2, 2, 3};
       int[] b = {2, 5, 1};
       int[] c = difference(a, b); // The elements c in a will b: [0, 2, 3].
       
      Parameters:
      a - The first int array.
      b - The second int array.
      Returns:
      A new int array containing the elements that are present in a but not in b. If a is empty or null, an empty array is returned. If b is empty or null, a clone of a is returned
    • difference

      public static long[] difference(long[] a, long[] b)
      Returns the elements in the specified long array a but not present in the long array b. Occurrences are considered.
      Parameters:
      a - The first long array.
      b - The second long array.
      Returns:
      A new long array containing the elements that are present in a but not in b. If a is empty or null, an empty array is returned. If b is empty or null, a clone of a is returned
      See Also:
    • difference

      public static float[] difference(float[] a, float[] b)
      Returns the elements in the specified float array a but not present in the float array b. Occurrences are considered.
      Parameters:
      a - The first float array.
      b - The second float array.
      Returns:
      A new float array containing the elements that are present in a but not in b. If a is empty or null, an empty array is returned. If b is empty or null, a clone of a is returned
      See Also:
    • difference

      public static double[] difference(double[] a, double[] b)
      Returns the elements in the specified double array a but not present in the double array b. Occurrences are considered.
      Parameters:
      a - The first double array.
      b - The second double array.
      Returns:
      A new double array containing the elements that are present in a but not in b. If a is empty or null, an empty array is returned. If b is empty or null, a clone of a is returned
      See Also:
    • difference

      public static <T> List<T> difference(T[] a, Object[] b)
      Returns the elements in the specified arrays a but not present in the specified array b. Occurrences are considered.
      Type Parameters:
      T - The type of the elements in the input array.
      Parameters:
      a - The first array.
      b - The second array.
      Returns:
      A new list containing the elements that are present in a but not in b. If a is empty or null, an empty list is returned. If b is empty or null, a clone of a is returned
      See Also:
    • difference

      public static <T> List<T> difference(Collection<? extends T> a, Collection<?> b)
      Returns the elements in the specified collections a but not present in the specified collection b. Occurrences are considered.
      Type Parameters:
      T - The type of the elements in the collections.
      Parameters:
      a - The first collection.
      b - The second collection.
      Returns:
      A new list containing the elements that are present in a but not in b. If a is empty or null, an empty list is returned. If b is empty or null, a new list with all element from a is returned
      See Also:
    • symmetricDifference

      public static boolean[] symmetricDifference(boolean[] a, boolean[] b)
      Returns the elements that are present in either a or b but not in both. Occurrences are considered.
      Parameters:
      a - The first boolean array.
      b - The second boolean array.
      Returns:
      A new boolean array containing the elements that are present in either a or b but not in both. If both a and b are empty or null, an empty array is returned. If a is empty or null, a clone of b is returned. If b is empty or null, a clone of a is returned.
      See Also:
    • symmetricDifference

      public static char[] symmetricDifference(char[] a, char[] b)
      Returns the elements that are present in either a or b but not in both. Occurrences are considered.
      Parameters:
      a - The first char array.
      b - The second char array.
      Returns:
      A new char array containing the elements that are present in either a or b but not in both. If both a and b are empty or null, an empty array is returned. If a is empty or null, a clone of b is returned. If b is empty or null, a clone of a is returned.
      See Also:
    • symmetricDifference

      public static byte[] symmetricDifference(byte[] a, byte[] b)
      Returns the elements that are present in either a or b but not in both. Occurrences are considered.
      Parameters:
      a - The first byte array.
      b - The second byte array.
      Returns:
      A new byte array containing the elements that are present in either a or b but not in both. If both a and b are empty or null, an empty array is returned. If a is empty or null, a clone of b is returned. If b is empty or null, a clone of a is returned.
      See Also:
    • symmetricDifference

      public static short[] symmetricDifference(short[] a, short[] b)
      Returns the elements that are present in either a or b but not in both. Occurrences are considered.
      Parameters:
      a - The first short array.
      b - The second short array.
      Returns:
      A new short array containing the elements that are present in either a or b but not in both. If both a and b are empty or null, an empty array is returned. If a is empty or null, a clone of b is returned. If b is empty or null, a clone of a is returned.
      See Also:
    • symmetricDifference

      public static int[] symmetricDifference(int[] a, int[] b)
      Returns the elements that are present in either a or b but not in both. Occurrences are considered.
       int[] a = {0, 1, 2, 2, 3};
       int[] b = {2, 5, 1};
       int[] c = symmetricDifference(a, b); // The elements c in a will b: [0, 2, 3, 5].
       
      Parameters:
      a - The first int array.
      b - The second int array.
      Returns:
      A new int array containing the elements that are present in either a or b but not in both. If both a and b are empty or null, an empty array is returned. If a is empty or null, a clone of b is returned. If b is empty or null, a clone of a is returned.
      See Also:
    • symmetricDifference

      public static long[] symmetricDifference(long[] a, long[] b)
      Returns the elements that are present in either a or b but not in both. Occurrences are considered.
      Parameters:
      a - The first long array.
      b - The second long array.
      Returns:
      A new long array containing the elements that are present in either a or b but not in both. If both a and b are empty or null, an empty array is returned. If a is empty or null, a clone of b is returned. If b is empty or null, a clone of a is returned.
      See Also:
    • symmetricDifference

      public static float[] symmetricDifference(float[] a, float[] b)
      Returns the elements that are present in either a or b but not in both. Occurrences are considered.
      Parameters:
      a - The first float array.
      b - The second float array.
      Returns:
      A new float array containing the elements that are present in either a or b but not in both. If both a and b are empty or null, an empty array is returned. If a is empty or null, a clone of b is returned. If b is empty or null, a clone of a is returned.
      See Also:
    • symmetricDifference

      public static double[] symmetricDifference(double[] a, double[] b)
      Returns the elements that are present in either a or b but not in both. Occurrences are considered.
      Parameters:
      a - The first double array.
      b - The second double array.
      Returns:
      A new double array containing the elements that are present in either a or b but not in both. If both a and b are empty or null, an empty array is returned. If a is empty or null, a clone of b is returned. If b is empty or null, a clone of a is returned.
      See Also:
    • symmetricDifference

      public static <T> List<T> symmetricDifference(T[] a, T[] b)
      Returns the elements that are present in either a or b but not in both. Occurrences are considered.
      Type Parameters:
      T - The type of the elements in the arrays.
      Parameters:
      a - The first array.
      b - The second array.
      Returns:
      A new list containing the elements that are present in either a or b but not in both. If both a and b are empty or null, an empty list is returned. If a is empty or null, a list containing the elements of b is returned. If b is empty or null, a list containing the elements of a is returned.
      See Also:
    • symmetricDifference

      public static <T> List<T> symmetricDifference(Collection<? extends T> a, Collection<? extends T> b)
      Returns the elements that are present in either a or b but not in both. Occurrences are considered.
      Type Parameters:
      T - The type of the elements in the collections.
      Parameters:
      a - The first collection.
      b - The second collection.
      Returns:
      A new list containing the elements that are present in either a or b but not in both. If both a and b are empty or null, an empty list is returned. If a is empty or null, a list containing the elements of b is returned. If b is empty or null, a list containing the elements of a is returned.
      See Also:
    • commonSet

      public static <T> Set<T> commonSet(Collection<? extends T> a, Collection<?> b)
      Returns a set containing the common elements between the specified collections a and b.
      Type Parameters:
      T - The type of the elements in the collection a.
      Parameters:
      a - The first collection.
      b - The second collection.
      Returns:
      A set containing the elements that are present in both a and b. If either a or b is empty or null, an empty set is returned.
      See Also:
    • commonSet

      public static <T> Set<T> commonSet(Collection<? extends Collection<? extends T>> c)
      Returns a set containing the common elements among all the collections within the specified collection of collections.
      Type Parameters:
      T - The type of the elements in the collections.
      Parameters:
      c - The collection of collections to find the common elements of.
      Returns:
      A set containing the elements that are present in all collections within c. If c is empty or null, an empty set is returned. If c contains only one collection, a set containing the elements of this collection is returned.
      See Also:
    • exclude

      public static <T> List<T> exclude(Collection<? extends T> c, Object objToExclude)
      Returns a new List containing all the elements from the specified collection except all occurrences of specified objToExclude.
      Type Parameters:
      T - The type of the elements in the collection.
      Parameters:
      c - The collection from which to exclude the specified object.
      objToExclude - The object to exclude from the collection.
      Returns:
      A new List with the specified object excluded. If the collection c is empty or null, an empty list is returned.
      See Also:
    • excludeToSet

      public static <T> Set<T> excludeToSet(Collection<? extends T> c, Object objToExclude)
      Returns a new Set containing all the elements from the specified collection except all occurrences of specified objToExclude.
      Type Parameters:
      T - The type of the elements in the collection.
      Parameters:
      c - The collection from which to exclude the specified object.
      objToExclude - The object to exclude from the collection.
      Returns:
      A new Set with the specified object excluded. If the collection c is empty or null, an empty set is returned.
      See Also:
    • excludeAll

      public static <T> List<T> excludeAll(Collection<? extends T> c, Collection<?> objsToExclude)
      Returns a new List containing all the elements from the specified collection except all occurrences of elements in the specified objsToExclude. That's to say no more value from objsToExclude will present in the returned Set.
      Type Parameters:
      T - The type of the elements in the collection.
      Parameters:
      c - The collection from which to exclude the specified objects.
      objsToExclude - The objects to exclude from the collection.
      Returns:
      A new List with the specified objects excluded. If the collection c is empty or null, an empty list is returned.
      See Also:
    • excludeAllToSet

      public static <T> Set<T> excludeAllToSet(Collection<? extends T> c, Collection<?> objsToExclude)
      Returns a new Set containing all the elements from the specified collection except all occurrences of elements in the specified objsToExclude. That's to say no more value from objsToExclude will present in the returned Set.
      Type Parameters:
      T - The type of the elements in the collection.
      Parameters:
      c - The collection from which to exclude the specified objects.
      objsToExclude - The objects to exclude from the collection.
      Returns:
      A new Set with the specified objects excluded. If the collection c is empty or null, an empty set is returned.
      See Also:
    • isSubCollection

      public static boolean isSubCollection(@NotNull Collection<?> subColl, @NotNull Collection<?> coll) throws IllegalArgumentException
      Returns true if subColl is a sub-collection of coll, that is, if the cardinality of e in subColl is less than or equal to the cardinality of e in coll, for each element e in subColl.
      Parameters:
      subColl - the first (sub?) collection, must not be null
      coll - the second (super?) collection, must not be null
      Returns:
      true if subColl is a sub-collection of coll
      Throws:
      IllegalArgumentException - if subColl or coll is null
      See Also:
    • isProperSubCollection

      public static boolean isProperSubCollection(@NotNull Collection<?> subColl, @NotNull Collection<?> coll) throws IllegalArgumentException
      Returns true if subColl is a proper sub-collection of coll, that is, if the cardinality of e in subColl is less than or equal to the cardinality of e in coll, for each element e in subColl, and there is at least one element f such that the cardinality of f in coll is strictly greater than the cardinality of f in subColl.

      The implementation assumes

      • subColl.size() and coll.size() represent the total cardinality of a and b, resp.
      • subColl.size() < Integer.MAXVALUE
      Parameters:
      subColl - the first (sub?) collection, must not be null
      coll - the second (super?) collection, must not be null
      Returns:
      true if subColl is a proper sub-collection of coll
      Throws:
      IllegalArgumentException - if subColl or coll is null
      See Also:
    • isEqualCollection

      public static boolean isEqualCollection(Collection<?> a, Collection<?> b)
      Returns true if the given Collections contain exactly the same elements with exactly the same cardinalities.

      That is, if the cardinality of e in a is equal to the cardinality of e in b, for each element e in a or b.

      Parameters:
      a - the first collection
      b - the second collection
      Returns:
      true if the collections contain the same elements with the same cardinalities.
    • replaceIf

      public static int replaceIf(boolean[] a, BooleanPredicate predicate, boolean newValue)
      Replaces all elements in the given boolean array that satisfy the provided predicate with a specified boolean value.
      Parameters:
      a - The boolean array in which to replace values.
      predicate - The predicate used to determine which elements should be replaced.
      newValue - The boolean value to replace with if the predicate is satisfied.
      Returns:
      The number of replacements made. If the input array is empty or null, zero is returned.
    • replaceIf

      public static int replaceIf(char[] a, CharPredicate predicate, char newValue)
      Replaces all elements in the given char array that satisfy the provided predicate with a specified char value.
      Parameters:
      a - The char array to be modified.
      predicate - The predicate used to determine which elements should be replaced.
      newValue - The char value to replace all elements that satisfy the predicate.
      Returns:
      The number of replacements made. If the input array is empty or null, zero is returned.
    • replaceIf

      public static int replaceIf(byte[] a, BytePredicate predicate, byte newValue)
      Replaces all elements in the given byte array that satisfy the provided predicate with a specified byte value.
      Parameters:
      a - The byte array to be modified.
      predicate - The predicate used to determine which elements should be replaced.
      newValue - The byte value to replace all elements that satisfy the predicate.
      Returns:
      The number of replacements made. If the input array is empty or null, zero is returned.
    • replaceIf

      public static int replaceIf(short[] a, ShortPredicate predicate, short newValue)
      Replaces all elements in the given short array that satisfy the provided predicate with a specified short value.
      Parameters:
      a - The short array to be modified.
      predicate - The predicate used to determine which elements should be replaced.
      newValue - The short value to replace all elements that satisfy the predicate.
      Returns:
      The number of replacements made. If the input array is empty or null, zero is returned.
    • replaceIf

      public static int replaceIf(int[] a, IntPredicate predicate, int newValue)
      Replaces all elements in the given int array that satisfy the provided predicate with a specified int value.
      Parameters:
      a - The int array to be modified.
      predicate - The predicate used to determine which elements should be replaced.
      newValue - The int value to replace all elements that satisfy the predicate.
      Returns:
      The number of replacements made. If the input array is empty or null, zero is returned.
    • replaceIf

      public static int replaceIf(long[] a, LongPredicate predicate, long newValue)
      Replaces all elements in the given long array that satisfy the provided predicate with a specified long value.
      Parameters:
      a - The long array to be modified.
      predicate - The predicate used to determine which elements should be replaced.
      newValue - The long value to replace all elements that satisfy the predicate.
      Returns:
      The number of replacements made. If the input array is empty or null, zero is returned.
    • replaceIf

      public static int replaceIf(float[] a, FloatPredicate predicate, float newValue)
      Replaces all elements in the given float array that satisfy the provided predicate with a specified float value.
      Parameters:
      a - The float array to be modified.
      predicate - The predicate used to determine which elements should be replaced.
      newValue - The float value to replace all elements that satisfy the predicate.
      Returns:
      The number of replacements made. If the input array is empty or null, zero is returned.
    • replaceIf

      public static int replaceIf(double[] a, DoublePredicate predicate, double newValue)
      Replaces all elements in the given double array that satisfy the provided predicate with a specified double value.
      Parameters:
      a - The double array to be modified.
      predicate - The predicate used to determine which elements should be replaced.
      newValue - The double value to replace all elements that satisfy the predicate.
      Returns:
      The number of replacements made. If the input array is empty or null, zero is returned.
    • replaceIf

      public static <T> int replaceIf(T[] a, Predicate<? super T> predicate, T newValue)
      Replaces all elements in the given array that satisfy the provided predicate with a specified value.
      Type Parameters:
      T - The type of elements in the array.
      Parameters:
      a - The array to be modified.
      predicate - The predicate used to determine which elements should be replaced.
      newValue - The value to replace all elements that satisfy the predicate.
      Returns:
      The number of replacements made. If the input array is empty or null, zero is returned.
    • replaceIf

      public static <T> int replaceIf(List<T> list, Predicate<? super T> predicate, T newValue)
      Replaces all elements in the given list that satisfy the provided predicate with a specified value.
      Type Parameters:
      T - The type of elements in the list.
      Parameters:
      list - The list to be modified.
      predicate - The predicate used to determine which elements should be replaced.
      newValue - The value to replace all elements that satisfy the predicate.
      Returns:
      The number of replacements made. If the input list is empty or null, zero is returned.
    • replaceAll

      public static int replaceAll(boolean[] a, boolean oldVal, boolean newVal)
      Replaces all occurrences of the specified old value with the new value in the given boolean array.
      Parameters:
      a - The boolean array in which to replace values.
      oldVal - The value to be replaced.
      newVal - The value to replace with.
      Returns:
      The number of replacements made. If the input array is empty or null, zero is returned.
    • replaceAll

      public static int replaceAll(char[] a, char oldVal, char newVal)
      Replaces all occurrences of the specified old value with the new value in the given char array.
      Parameters:
      a - The char array in which replacements are to be made.
      oldVal - The char value to be replaced.
      newVal - The char value to replace all occurrences of the oldVal.
      Returns:
      The number of replacements made. If the input array is empty or null, zero is returned.
    • replaceAll

      public static int replaceAll(byte[] a, byte oldVal, byte newVal)
      Replaces all occurrences of the specified old value with the new value in the given byte array.
      Parameters:
      a - The byte array in which to replace values.
      oldVal - The value to be replaced.
      newVal - The value to replace with.
      Returns:
      The number of replacements made. If the input array is empty or null, zero is returned.
    • replaceAll

      public static int replaceAll(short[] a, short oldVal, short newVal)
      Replaces all occurrences of the specified old value with the new value in the given short array.
      Parameters:
      a - The short array in which to replace values.
      oldVal - The value to be replaced.
      newVal - The value to replace with.
      Returns:
      The number of replacements made. If the input array is empty or null, zero is returned.
    • replaceAll

      public static int replaceAll(int[] a, int oldVal, int newVal)
      Replaces all occurrences of the specified old value with the new value in the given int array.
      Parameters:
      a - The int array in which to replace values.
      oldVal - The value to be replaced.
      newVal - The value to replace with.
      Returns:
      The number of replacements made. If the input array is empty or null, zero is returned.
    • replaceAll

      public static int replaceAll(long[] a, long oldVal, long newVal)
      Replaces all occurrences of the specified old value with the new value in the given long array.
      Parameters:
      a - The long array in which to replace values.
      oldVal - The value to be replaced.
      newVal - The value to replace with.
      Returns:
      The number of replacements made. If the input array is empty or null, zero is returned.
    • replaceAll

      public static int replaceAll(float[] a, float oldVal, float newVal)
      Replaces all occurrences of the specified old value with the new value in the given float array.
      Parameters:
      a - The float array in which to replace values.
      oldVal - The value to be replaced.
      newVal - The value to replace with.
      Returns:
      The number of replacements made. If the input array is empty or null, zero is returned.
    • replaceAll

      public static int replaceAll(double[] a, double oldVal, double newVal)
      Replaces all occurrences of the specified old value with the new value in the given double array.
      Parameters:
      a - The double array in which to replace values.
      oldVal - The value to be replaced.
      newVal - The value to replace with.
      Returns:
      The number of replacements made. If the input array is empty or null, zero is returned.
    • replaceAll

      public static <T> int replaceAll(T[] a, Object oldVal, T newVal)
      Replaces all occurrences of the specified old value with the new value in the given array.
      Type Parameters:
      T - The type of elements in the array.
      Parameters:
      a - The array in which to replace values.
      oldVal - The value to be replaced.
      newVal - The value to replace with.
      Returns:
      The number of replacements made. If the input array is empty or null, zero is returned.
    • replaceAll

      public static <T> int replaceAll(List<T> list, Object oldVal, T newVal)
      Replaces all occurrences of the specified old value with the new value in the given list.
      Type Parameters:
      T - The type of elements in the list.
      Parameters:
      list - The list in which to replace values.
      oldVal - The value to be replaced.
      newVal - The value to replace with.
      Returns:
      The number of replacements made. If the input list is empty or null, zero is returned.
    • replaceAll

      public static void replaceAll(boolean[] a, BooleanUnaryOperator operator)
      Replaces all elements in the given boolean array using the specified BooleanUnaryOperator. If the input array is empty or null, no replacements are made.
      Parameters:
      a - The boolean array in which to replace values.
      operator - The BooleanUnaryOperator to apply to each element. The operator takes a boolean value and returns a boolean value.
      See Also:
    • replaceAll

      public static void replaceAll(char[] a, CharUnaryOperator operator)
      Replaces all elements in the given char array using the specified CharUnaryOperator. If the input array is empty or null, no replacements are made.
      Parameters:
      a - The char array in which to replace values.
      operator - The CharUnaryOperator to apply to each element. The operator takes a char value and returns a char value.
      See Also:
    • replaceAll

      public static void replaceAll(byte[] a, ByteUnaryOperator operator)
      Replaces all elements in the given byte array using the specified ByteUnaryOperator. If the input array is empty or null, no replacements are made.
      Parameters:
      a - The byte array in which to replace values.
      operator - The ByteUnaryOperator to apply to each element. The operator takes a byte value and returns a byte value.
      See Also:
    • replaceAll

      public static void replaceAll(short[] a, ShortUnaryOperator operator)
      Replaces all elements in the given short array using the specified ShortUnaryOperator. If the input array is empty or null, no replacements are made.
      Parameters:
      a - The short array in which to replace values.
      operator - The ShortUnaryOperator to apply to each element. The operator takes a short value and returns a short value.
      See Also:
    • replaceAll

      public static void replaceAll(int[] a, IntUnaryOperator operator)
      Replaces all elements in the given int array using the specified IntUnaryOperator. If the input array is empty or null, no replacements are made.
      Parameters:
      a - The int array in which to replace values.
      operator - The IntUnaryOperator to apply to each element. The operator takes an int value and returns an int value.
      See Also:
    • replaceAll

      public static void replaceAll(long[] a, LongUnaryOperator operator)
      Replaces all elements in the given long array using the specified LongUnaryOperator. If the input array is empty or null, no replacements are made.
      Parameters:
      a - The long array in which to replace values.
      operator - The LongUnaryOperator to apply to each element. The operator takes a long value and returns a long value.
      See Also:
    • replaceAll

      public static void replaceAll(float[] a, FloatUnaryOperator operator)
      Replaces all elements in the given float array using the specified FloatUnaryOperator. If the input array is empty or null, no replacements are made.
      Parameters:
      a - The float array in which to replace values.
      operator - The FloatUnaryOperator to apply to each element. The operator takes a float value and returns a float value.
      See Also:
    • replaceAll

      public static void replaceAll(double[] a, DoubleUnaryOperator operator)
      Replaces all elements in the given double array using the specified DoubleUnaryOperator. If the input array is empty or null, no replacements are made.
      Parameters:
      a - The double array in which to replace values.
      operator - The DoubleUnaryOperator to apply to each element. The operator takes a double value and returns a double value.
      See Also:
    • replaceAll

      public static <T> void replaceAll(T[] a, UnaryOperator<T> operator)
      Replaces all elements in the given array using the specified UnaryOperator. If the input array is empty or null, no replacements are made.
      Type Parameters:
      T - The type of elements in the array.
      Parameters:
      a - The array in which to replace values.
      operator - The UnaryOperator to apply to each element. The operator takes a value of type T and returns a value of type T.
      See Also:
    • replaceAll

      public static <T> void replaceAll(List<T> list, UnaryOperator<T> operator)
      Replaces all elements in the given list using the specified UnaryOperator. If the input list is empty or null, no replacements are made.
      Type Parameters:
      T - The type of elements in the list.
      Parameters:
      list - The list in which to replace values.
      operator - The UnaryOperator to apply to each element. The operator takes a value of type T and returns a value of type T.
      See Also:
    • updateAllUsingReplaceAllInstead

      @Deprecated public static void updateAllUsingReplaceAllInstead() throws UnsupportedOperationException
      Deprecated.
      use replaceAll
      A fake/unsupported method defined to remind user to use replaceAll when update/updateAll/updateIf is searched.
      Throws:
      UnsupportedOperationException
      See Also:
    • updateIfUsingReplaceIfInstead

      @Deprecated public static void updateIfUsingReplaceIfInstead() throws UnsupportedOperationException
      Deprecated.
      use replaceIf
      A fake/unsupported method defined to remind user to use replaceIf when update/updateAll/updateIf is searched.
      Throws:
      UnsupportedOperationException
      See Also:
    • setAll

      public static void setAll(boolean[] array, IntToBooleanFunction generator)
      Sets all elements in the given array using the provided generator function. If the specified array is null or empty, does nothing.
      Parameters:
      array - the array to be modified
      generator - the function used to generate new values for the array elements
      See Also:
    • setAll

      public static void setAll(char[] array, IntToCharFunction generator)
      Sets all elements in the given array using the provided generator function. If the specified array is null or empty, does nothing.
      Parameters:
      array - the array to be modified
      generator - the function used to generate new values for the array elements
      See Also:
    • setAll

      public static void setAll(byte[] array, IntToByteFunction generator)
      Sets all elements in the given array using the provided generator function. If the specified array is null or empty, does nothing.
      Parameters:
      array - the array to be modified
      generator - the function used to generate new values for the array elements
      See Also:
    • setAll

      public static void setAll(short[] array, IntToShortFunction generator)
      Sets all elements in the given array using the provided generator function. If the specified array is null or empty, does nothing.
      Parameters:
      array - the array to be modified
      generator - the function used to generate new values for the array elements
      See Also:
    • setAll

      public static void setAll(int[] array, IntUnaryOperator generator)
      Sets all elements in the given array using the provided generator function. If the specified array is null or empty, does nothing.
      Parameters:
      array - the array to be modified
      generator - the function used to generate new values for the array elements
      See Also:
    • setAll

      public static void setAll(long[] array, IntToLongFunction generator)
      Sets all elements in the given array using the provided generator function. If the specified array is null or empty, does nothing.
      Parameters:
      array - the array to be modified
      generator - the function used to generate new values for the array elements
      See Also:
    • setAll

      public static void setAll(float[] array, IntToFloatFunction generator)
      Sets all elements in the given array using the provided generator function. If the specified array is null or empty, does nothing.
      Parameters:
      array - the array to be modified
      generator - the function used to generate new values for the array elements
      See Also:
    • setAll

      public static void setAll(double[] array, IntToDoubleFunction generator)
      Sets all elements in the given array using the provided generator function. If the specified array is null or empty, does nothing.
      Parameters:
      array - the array to be modified
      generator - the function used to generate new values for the array elements
      See Also:
    • setAll

      public static <T> void setAll(T[] array, IntFunction<? extends T> generator)
      Sets all elements in the given array using the provided generator function. If the specified array is null or empty, does nothing.
      Type Parameters:
      T - the type of elements in the input array
      Parameters:
      array - the array to be modified
      generator - the function used to generate new values for the array elements
      See Also:
    • setAll

      public static <T> void setAll(List<T> list, IntFunction<? extends T> generator)
      Sets all elements in the given list using the provided generator function. If the specified list is null or empty, does nothing.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      list - the list to be modified
      generator - the function used to generate new values for the list elements
      See Also:
    • setAll

      @Beta public static <T, E extends Exception> void setAll(T[] a, Throwables.IntObjFunction<? super T,? extends T,E> converter) throws E
      Sets all elements in the given array using the provided converter function. If the specified array is null or empty, does nothing.
      Type Parameters:
      T - the type of elements in the array
      E - the type of exception that the converter may throw
      Parameters:
      a - the array to be modified
      converter - the function used to generate new values for the array elements with the index of the element as the first parameter and the original element as the second parameter
      Throws:
      E - if the converter function throws an exception
      See Also:
    • setAll

      @Beta public static <T, E extends Exception> void setAll(List<T> list, Throwables.IntObjFunction<? super T,? extends T,E> converter) throws E
      Sets all elements in the given list using the provided converter function. If the specified list is null or empty, does nothing.
      Type Parameters:
      T - the type of elements in the list
      E - the type of exception that the converter may throw
      Parameters:
      list - the list to be modified
      converter - the function used to generate new values for the list elements with the index of the element as the first parameter and the original element as the second parameter
      Throws:
      E - if the converter function throws an exception
      See Also:
    • copyThenSetAll

      @MayReturnNull public static <T> T[] copyThenSetAll(T[] a, IntFunction<? extends T> generator)
      Creates a copy of the given array and sets all elements in the copy using the provided generator function. If the specified array is null, returns null. If the specified array is empty, returns itself.
      Type Parameters:
      T - the type of elements in the array
      Parameters:
      a - the array to be copied and modified
      generator - the function used to generate new values for the array elements
      Returns:
      a new array with elements copied from the specified array and modified by the generator function
      See Also:
    • copyThenSetAll

      @MayReturnNull public static <T, E extends Exception> T[] copyThenSetAll(T[] a, Throwables.IntObjFunction<? super T,? extends T,E> converter) throws E
      Creates a copy of the given array and sets all elements in the copy using the provided converter function. If the specified array is null, returns null. If the specified array is empty, returns itself.
      Type Parameters:
      T - the type of elements in the array
      E - the type of exception that the converter may throw
      Parameters:
      a - the array to be copied and modified
      converter - the function used to generate new values for the array elements with the index of the element as the first parameter and the original element as the second parameter
      Returns:
      a new array with elements copied from the specified array and modified by the converter function
      Throws:
      E - if the converter function throws an exception
      See Also:
    • copyThenReplaceAll

      @MayReturnNull public static <T> T[] copyThenReplaceAll(T[] a, UnaryOperator<T> operator)
      Creates a copy of the given array and replaces all elements in the copy using the provided UnaryOperator. If the specified array is null, returns null. If the specified array is empty, returns itself.
      Type Parameters:
      T - the type of elements in the array
      Parameters:
      a - the array to be copied and modified
      operator - The UnaryOperator to apply to each element. The operator takes a value of type T and returns a value of type T.
      Returns:
      a new array with elements copied from the specified array and modified by provided UnaryOperator
      See Also:
    • add

      public static boolean[] add(boolean[] a, boolean elementToAdd)
      Returns a new array with elements copied from the specified array and the specified element added at the end.
      The original array remains unchanged.
      Parameters:
      a - The original boolean array.
      elementToAdd - The boolean element to be added to the array.
      Returns:
      A new boolean array containing the original elements and the added element.
    • add

      public static char[] add(char[] a, char elementToAdd)
      Returns a new array with elements copied from the specified array and the specified element added at the end.
      The original array remains unchanged.
      Parameters:
      a - The original char array.
      elementToAdd - The char element to be added to the array.
      Returns:
      A new char array containing the original elements and the added element.
    • add

      public static byte[] add(byte[] a, byte elementToAdd)
      Returns a new array with elements copied from the specified array and the specified element added at the end.
      The original array remains unchanged.
      Parameters:
      a - The original byte array.
      elementToAdd - The byte element to be added to the array.
      Returns:
      A new byte array containing the original elements and the added element.
    • add

      public static short[] add(short[] a, short elementToAdd)
      Returns a new array with elements copied from the specified array and the specified element added at the end.
      The original array remains unchanged.
      Parameters:
      a - The original short array.
      elementToAdd - The short element to be added to the array.
      Returns:
      A new short array containing the original elements and the added element.
    • add

      public static int[] add(int[] a, int elementToAdd)
      Returns a new array with elements copied from the specified array and the specified element added at the end.
      The original array remains unchanged.
      Parameters:
      a - The original int array.
      elementToAdd - The int element to be added to the array.
      Returns:
      A new int array containing the original elements and the added element.
    • add

      public static long[] add(long[] a, long elementToAdd)
      Returns a new array with elements copied from the specified array and the specified element added at the end.
      The original array remains unchanged.
      Parameters:
      a - The original long array.
      elementToAdd - The long element to be added to the array.
      Returns:
      A new long array containing the original elements and the added element.
    • add

      public static float[] add(float[] a, float elementToAdd)
      Returns a new array with elements copied from the specified array and the specified element added at the end.
      The original array remains unchanged.
      Parameters:
      a - The original float array.
      elementToAdd - The float element to be added to the array.
      Returns:
      A new float array containing the original elements and the added element.
    • add

      public static double[] add(double[] a, double elementToAdd)
      Returns a new array with elements copied from the specified array and the specified element added at the end.
      The original array remains unchanged.
      Parameters:
      a - The original double array.
      elementToAdd - The double element to be added to the array.
      Returns:
      A new double array containing the original elements and the added element.
    • add

      public static String[] add(String[] a, String elementToAdd)
      Returns a new array with elements copied from the specified array and the specified element added at the end.
      The original array remains unchanged.
      Parameters:
      a - The original String array.
      elementToAdd - The String element to be added to the array.
      Returns:
      A new String array containing the original elements and the added element.
    • add

      public static <T> T[] add(@NotNull T[] a, T elementToAdd) throws IllegalArgumentException
      Returns a new array with elements copied from the specified array and the specified element added at the end.
      The original array remains unchanged.
      Type Parameters:
      T - The type of elements in the array.
      Parameters:
      a - The original array.
      elementToAdd - The element to be added to the array.
      Returns:
      A new array containing the original elements and the added element.
      Throws:
      IllegalArgumentException - if the original array is null.
    • addAll

      @SafeVarargs public static boolean[] addAll(boolean[] a, boolean... elementsToAdd)
      Returns a new array with elements copied from the specified array and the specified element added at the end.
      The original array remains unchanged.
      Parameters:
      a - The first array whose elements are added to the new array.
      elementsToAdd - The additional elements to be added to the new array.
      Returns:
      A new boolean array containing the elements from a and elementsToAdd.
    • addAll

      @SafeVarargs public static char[] addAll(char[] a, char... elementsToAdd)
      Returns a new array with elements copied from the specified array and the specified element added at the end.
      The original array remains unchanged.
      Parameters:
      a - The first array whose elements are added to the new array.
      elementsToAdd - The additional elements to be added to the new array.
      Returns:
      A new char array containing the elements from a and elementsToAdd.
    • addAll

      @SafeVarargs public static byte[] addAll(byte[] a, byte... elementsToAdd)
      Returns a new array with elements copied from the specified array and the specified elements added at the end.
      The original array remains unchanged.
      Parameters:
      a - The first array whose elements are added to the new array.
      elementsToAdd - The additional elements to be added to the new array.
      Returns:
      A new byte array containing the elements from a and elementsToAdd.
    • addAll

      @SafeVarargs public static short[] addAll(short[] a, short... elementsToAdd)
      Returns a new array with elements copied from the specified array and the specified elements added at the end.
      The original array remains unchanged.
      Parameters:
      a - The first array whose elements are added to the new array.
      elementsToAdd - The additional elements to be added to the new array.
      Returns:
      A new short array containing the elements from a and elementsToAdd.
    • addAll

      @SafeVarargs public static int[] addAll(int[] a, int... elementsToAdd)
      Returns a new array with elements copied from the specified array and the specified elements added at the end.
      The original array remains unchanged.
      Parameters:
      a - The first array whose elements are added to the new array.
      elementsToAdd - The additional elements to be added to the new array.
      Returns:
      A new int array containing the elements from a and elementsToAdd.
    • addAll

      @SafeVarargs public static long[] addAll(long[] a, long... elementsToAdd)
      Returns a new array with elements copied from the specified array and the specified elements added at the end.
      The original array remains unchanged.
      Parameters:
      a - The first array whose elements are added to the new array.
      elementsToAdd - The additional elements to be added to the new array.
      Returns:
      A new long array containing the elements from a and elementsToAdd.
    • addAll

      @SafeVarargs public static float[] addAll(float[] a, float... elementsToAdd)
      Returns a new array with elements copied from the specified array and the specified elements added at the end.
      The original array remains unchanged.
      Parameters:
      a - The first array whose elements are added to the new array.
      elementsToAdd - The additional elements to be added to the new array.
      Returns:
      A new float array containing the elements from a and elementsToAdd.
    • addAll

      @SafeVarargs public static double[] addAll(double[] a, double... elementsToAdd)
      Returns a new array with elements copied from the specified array and the specified elements added at the end.
      The original array remains unchanged.
      Parameters:
      a - The first array whose elements are added to the new array.
      elementsToAdd - The additional elements to be added to the new array.
      Returns:
      A new double array containing the elements from a and elementsToAdd.
    • addAll

      @SafeVarargs public static String[] addAll(String[] a, String... elementsToAdd)
      Returns a new array with elements copied from the specified array and the specified elements added at the end.
      The original array remains unchanged.
      Parameters:
      a - The first array whose elements are added to the new array.
      elementsToAdd - The additional elements to be added to the new array.
      Returns:
      A new String array containing the elements from a and elementsToAdd.
    • addAll

      @SafeVarargs public static <T> T[] addAll(@NotNull T[] a, T... elementsToAdd) throws IllegalArgumentException
      Returns a new array with elements copied from the specified array and the specified elements added at the end.
      The original array remains unchanged.
      Type Parameters:
      T - The type of elements in the array.
      Parameters:
      a - The original array.
      elementsToAdd - The elements to be added to the array.
      Returns:
      A new array containing the original elements and the added elements.
      Throws:
      IllegalArgumentException - if the input array a and elementsToAdd both are null.
    • addAll

      public static <T> boolean addAll(@NotNull Collection<T> c, T... elementsToAdd) throws IllegalArgumentException
      Adds all the elements in elementsToAdd to the given collection.
      Type Parameters:
      T - The type of elements in the collection.
      Parameters:
      c - The original collection.
      elementsToAdd - The elements to be added to the collection.
      Returns:
      A boolean indicating if the collection changed as a result of the call.
      Throws:
      IllegalArgumentException - if the original collection is null.
    • addAll

      public static <T> boolean addAll(@NotNull Collection<T> c, Iterable<? extends T> elementsToAdd) throws IllegalArgumentException
      Adds all the elements in elementsToAdd to the given collection.
      Type Parameters:
      T - The type of elements in the collection.
      Parameters:
      c - The original collection where elements are to be added.
      elementsToAdd - The collection of elements to be added to the original collection.
      Returns:
      A boolean indicating if the original collection changed as a result of the call.
      Throws:
      IllegalArgumentException - if the original collection is null.
    • addAll

      public static <T> boolean addAll(@NotNull Collection<T> c, Iterator<? extends T> elementsToAdd) throws IllegalArgumentException
      Adds all the elements in elementsToAdd to the given collection.
      Type Parameters:
      T - The type of elements in the collection.
      Parameters:
      c - The original collection where elements are to be added.
      elementsToAdd - The iterator of elements to be added to the original collection.
      Returns:
      A boolean indicating if the original collection changed as a result of the call.
      Throws:
      IllegalArgumentException - if the original collection is null.
    • insert

      public static boolean[] insert(boolean[] a, int index, boolean elementToInsert) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
      The original array remains unchanged.
      Parameters:
      a - the original boolean array
      index - the position in the array where the new element should be inserted
      elementToInsert - the char value to be inserted into the array
      Returns:
      a new char array with the original elements and the inserted element
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insert

      public static char[] insert(char[] a, int index, char elementToInsert) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
      The original array remains unchanged.
      Parameters:
      a - the original char array
      index - the position in the array where the new element should be inserted
      elementToInsert - the boolean value to be inserted into the array
      Returns:
      a new boolean array with the original elements and the inserted element
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insert

      public static byte[] insert(byte[] a, int index, byte elementToInsert) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
      The original array remains unchanged.
      Parameters:
      a - the original byte array
      index - the position in the array where the new element should be inserted
      elementToInsert - the byte value to be inserted into the array
      Returns:
      a new byte array with the original elements and the inserted element
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insert

      public static short[] insert(short[] a, int index, short elementToInsert) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
      The original array remains unchanged.
      Parameters:
      a - the original short array
      index - the position in the array where the new element should be inserted
      elementToInsert - the short value to be inserted into the array
      Returns:
      a new short array with the original elements and the inserted element
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insert

      public static int[] insert(int[] a, int index, int elementToInsert) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
      The original array remains unchanged.
      Parameters:
      a - the original int array
      index - the position in the array where the new element should be inserted
      elementToInsert - the int value to be inserted into the array
      Returns:
      a new int array with the original elements and the inserted element
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insert

      public static long[] insert(long[] a, int index, long elementToInsert) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
      The original array remains unchanged.
      Parameters:
      a - the original long array
      index - the position in the array where the new element should be inserted
      elementToInsert - the long value to be inserted into the array
      Returns:
      a new long array with the original elements and the inserted element
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insert

      public static float[] insert(float[] a, int index, float elementToInsert) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
      The original array remains unchanged.
      Parameters:
      a - the original float array
      index - the position in the array where the new element should be inserted
      elementToInsert - the float value to be inserted into the array
      Returns:
      a new float array with the original elements and the inserted element
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insert

      public static double[] insert(double[] a, int index, double elementToInsert) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
      The original array remains unchanged.
      Parameters:
      a - the original double array
      index - the position in the array where the new element should be inserted
      elementToInsert - the double value to be inserted into the array
      Returns:
      a new double array with the original elements and the inserted element
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insert

      public static String[] insert(String[] a, int index, String elementToInsert) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
      The original array remains unchanged.
      Parameters:
      a - the original String array
      index - the position in the array where the new element should be inserted
      elementToInsert - the String value to be inserted into the array
      Returns:
      a new String array with the original elements and the inserted element
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insert

      public static <T> T[] insert(@NotNull T[] a, int index, T elementToInsert) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
      The original array remains unchanged.
      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the original array
      index - the position in the array where the new element should be inserted
      elementToInsert - the element to be inserted into the array
      Returns:
      a new array with the original elements and the inserted element
      Throws:
      IllegalArgumentException - if the original array is null
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insert

      public static String insert(String str, int index, String strToInsert) throws IndexOutOfBoundsException
      Returns a new String with chars copied from the specified String and the specified String inserted at the specified index.
      The original String remains unchanged.
      Parameters:
      str - the original string
      index - the position in the string where the new string should be inserted
      strToInsert - the string to be inserted into the original string
      Returns:
      a new string with the original characters and the inserted string
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > str.length())
    • insertAll

      @SafeVarargs public static boolean[] insertAll(boolean[] a, int index, boolean... elementsToInsert) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
      The original array remains unchanged.
      Parameters:
      a - the original array
      index - the position in the array where the new elements should be inserted
      elementsToInsert - the elements to be inserted into the array
      Returns:
      a new array with the original elements and the inserted elements
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insertAll

      @SafeVarargs public static char[] insertAll(char[] a, int index, char... elementsToInsert) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
      The original array remains unchanged.
      Parameters:
      a - the original array
      index - the position in the array where the new elements should be inserted
      elementsToInsert - the elements to be inserted into the array
      Returns:
      a new array with the original elements and the inserted elements
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insertAll

      @SafeVarargs public static byte[] insertAll(byte[] a, int index, byte... elementsToInsert) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
      The original array remains unchanged.
      Parameters:
      a - the original array
      index - the position in the array where the new elements should be inserted
      elementsToInsert - the elements to be inserted into the array
      Returns:
      a new array with the original elements and the inserted elements
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insertAll

      @SafeVarargs public static short[] insertAll(short[] a, int index, short... elementsToInsert) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
      The original array remains unchanged.
      Parameters:
      a - the original array
      index - the position in the array where the new elements should be inserted
      elementsToInsert - the elements to be inserted into the array
      Returns:
      a new array with the original elements and the inserted elements
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insertAll

      @SafeVarargs public static int[] insertAll(int[] a, int index, int... elementsToInsert) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
      The original array remains unchanged.
      Parameters:
      a - the original array
      index - the position in the array where the new elements should be inserted
      elementsToInsert - the elements to be inserted into the array
      Returns:
      a new array with the original elements and the inserted elements
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insertAll

      @SafeVarargs public static long[] insertAll(long[] a, int index, long... elementsToInsert) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
      The original array remains unchanged.
      Parameters:
      a - the original array
      index - the position in the array where the new elements should be inserted
      elementsToInsert - the elements to be inserted into the array
      Returns:
      a new array with the original elements and the inserted elements
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insertAll

      @SafeVarargs public static float[] insertAll(float[] a, int index, float... elementsToInsert) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
      The original array remains unchanged.
      Parameters:
      a - the original array
      index - the position in the array where the new elements should be inserted
      elementsToInsert - the elements to be inserted into the array
      Returns:
      a new array with the original elements and the inserted elements
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insertAll

      @SafeVarargs public static double[] insertAll(double[] a, int index, double... elementsToInsert) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
      The original array remains unchanged.
      Parameters:
      a - the original array
      index - the position in the array where the new elements should be inserted
      elementsToInsert - the elements to be inserted into the array
      Returns:
      a new array with the original elements and the inserted elements
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insertAll

      @SafeVarargs public static String[] insertAll(String[] a, int index, String... elementsToInsert) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
      The original array remains unchanged.
      Parameters:
      a - the original array
      index - the position in the array where the new elements should be inserted
      elementsToInsert - the elements to be inserted into the array
      Returns:
      a new array with the original elements and the inserted elements
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insertAll

      @SafeVarargs public static <T> T[] insertAll(@NotNull T[] a, int index, T... elementsToInsert) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
      The original array remains unchanged.
      Parameters:
      a - the original array
      index - the position in the array where the new elements should be inserted
      elementsToInsert - the elements to be inserted into the array
      Returns:
      a new array with the original elements and the inserted elements
      Throws:
      IllegalArgumentException - if the specified Array is null.
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insertAll

      @SafeVarargs public static <T> boolean insertAll(@NotNull List<T> list, int index, T... elementsToInsert) throws IllegalArgumentException, IndexOutOfBoundsException
      Inserts the specified elements at the specified position in the list. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      list - the list to insert into
      index - the position in the list where the new elements should be inserted
      elementsToInsert - the elements to be inserted into the list
      Returns:
      true if the list changed as a result of the call
      Throws:
      IllegalArgumentException - if the list is null
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > list.size())
    • insertAll

      public static <T> boolean insertAll(@NotNull List<T> list, int index, Collection<? extends T> elementsToInsert) throws IllegalArgumentException, IndexOutOfBoundsException
      Inserts the specified elements at the specified position in the list. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      list - the list to insert into
      index - the position in the list where the new elements should be inserted
      elementsToInsert - the elements to be inserted into the list
      Returns:
      true if the list changed as a result of the call
      Throws:
      IllegalArgumentException - if the list is null
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > list.size())
    • deleteByIndex

      public static boolean[] deleteByIndex(@NotNull boolean[] a, int index) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the element at the specified position.
      The original array remains unchanged.
      Parameters:
      a - the original boolean array
      index - the position of the element to be removed
      Returns:
      a new boolean array containing the existing elements except the element at the specified index
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index >= a.length)
      IllegalArgumentException
    • deleteByIndex

      public static char[] deleteByIndex(@NotNull char[] a, int index) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the element at the specified position.
      The original array remains unchanged.
      Parameters:
      a - the original char array
      index - the position of the element to be removed
      Returns:
      a new char array containing the existing elements except the element at the specified index
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index >= a.length)
      IllegalArgumentException
    • deleteByIndex

      public static byte[] deleteByIndex(@NotNull byte[] a, int index) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the element at the specified position.
      The original array remains unchanged.
      Parameters:
      a - the original byte array
      index - the position of the element to be removed
      Returns:
      a new byte array containing the existing elements except the element at the specified index
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index >= a.length)
      IllegalArgumentException
    • deleteByIndex

      public static short[] deleteByIndex(@NotNull short[] a, int index) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the element at the specified position.
      The original array remains unchanged.
      Parameters:
      a - the original short array
      index - the position of the element to be removed
      Returns:
      a new short array containing the existing elements except the element at the specified index
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index >= a.length)
      IllegalArgumentException
    • deleteByIndex

      public static int[] deleteByIndex(@NotNull int[] a, int index) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the element at the specified position.
      The original array remains unchanged.
      Parameters:
      a - the original int array
      index - the position of the element to be removed
      Returns:
      a new int array containing the existing elements except the element at the specified index
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index >= a.length)
      IllegalArgumentException
    • deleteByIndex

      public static long[] deleteByIndex(@NotNull long[] a, int index) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the element at the specified position.
      The original array remains unchanged.
      Parameters:
      a - the original long array
      index - the position of the element to be removed
      Returns:
      a new long array containing the existing elements except the element at the specified index
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index >= a.length)
      IllegalArgumentException
    • deleteByIndex

      public static float[] deleteByIndex(@NotNull float[] a, int index) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the element at the specified position.
      The original array remains unchanged.
      Parameters:
      a - the original float array
      index - the position of the element to be removed
      Returns:
      a new float array containing the existing elements except the element at the specified index
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index >= a.length)
      IllegalArgumentException
    • deleteByIndex

      public static double[] deleteByIndex(@NotNull double[] a, int index) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the element at the specified position.
      The original array remains unchanged.
      Parameters:
      a - the original double array
      index - the position of the element to be removed
      Returns:
      a new double array containing the existing elements except the element at the specified index
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index >= a.length)
      IllegalArgumentException
    • deleteByIndex

      public static <T> T[] deleteByIndex(@NotNull T[] a, int index) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the element at the specified position.
      The original array remains unchanged.
      Parameters:
      a - the original array
      index - the position of the element to be removed
      Returns:
      a new array containing the existing elements except the element at the specified index
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index >= a.length)
      IllegalArgumentException
    • deleteAllByIndices

      @SafeVarargs public static boolean[] deleteAllByIndices(boolean[] a, int... indices) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the elements at the specified positions.
      The original array remains unchanged.
      Parameters:
      a - the input boolean array from which elements are to be removed
      indices - the positions of the elements to be removed
      Returns:
      a new boolean array containing the remaining elements after removal
      Throws:
      IndexOutOfBoundsException - if any index is out of the array's range
    • deleteAllByIndices

      @SafeVarargs public static char[] deleteAllByIndices(char[] a, int... indices) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the elements at the specified positions.
      The original array remains unchanged.
      Parameters:
      a - the input char array from which elements are to be removed
      indices - the positions of the elements to be removed
      Returns:
      a new char array containing the remaining elements after removal
      Throws:
      IndexOutOfBoundsException - if any index is out of the array's range
    • deleteAllByIndices

      @SafeVarargs public static byte[] deleteAllByIndices(byte[] a, int... indices) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the elements at the specified positions.
      The original array remains unchanged.
      Parameters:
      a - the input byte array from which elements are to be removed
      indices - the positions of the elements to be removed
      Returns:
      a new byte array containing the remaining elements after removal
      Throws:
      IndexOutOfBoundsException - if any index is out of the array's range
    • deleteAllByIndices

      @SafeVarargs public static short[] deleteAllByIndices(short[] a, int... indices) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the elements at the specified positions.
      The original array remains unchanged.
      Parameters:
      a - the input short array from which elements are to be removed
      indices - the positions of the elements to be removed
      Returns:
      a new short array containing the remaining elements after removal
      Throws:
      IndexOutOfBoundsException - if any index is out of the array's range
    • deleteAllByIndices

      @SafeVarargs public static int[] deleteAllByIndices(int[] a, int... indices) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the elements at the specified positions.
      The original array remains unchanged.
      Parameters:
      a - the input int array from which elements are to be removed
      indices - the positions of the elements to be removed
      Returns:
      a new int array containing the remaining elements after removal
      Throws:
      IndexOutOfBoundsException - if any index is out of the array's range
    • deleteAllByIndices

      @SafeVarargs public static long[] deleteAllByIndices(long[] a, int... indices) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the elements at the specified positions.
      The original array remains unchanged.
      Parameters:
      a - the input long array from which elements are to be removed
      indices - the positions of the elements to be removed
      Returns:
      a new long array containing the remaining elements after removal
      Throws:
      IndexOutOfBoundsException - if any index is out of the array's range
    • deleteAllByIndices

      @SafeVarargs public static float[] deleteAllByIndices(float[] a, int... indices) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the elements at the specified positions.
      The original array remains unchanged.
      Parameters:
      a - the input float array from which elements are to be removed
      indices - the positions of the elements to be removed
      Returns:
      a new float array containing the remaining elements after removal
      Throws:
      IndexOutOfBoundsException - if any index is out of the array's range
    • deleteAllByIndices

      @SafeVarargs public static double[] deleteAllByIndices(double[] a, int... indices) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the elements at the specified positions.
      The original array remains unchanged.
      Parameters:
      a - the input double array from which elements are to be removed
      indices - the positions of the elements to be removed
      Returns:
      a new double array containing the remaining elements after removal
      Throws:
      IndexOutOfBoundsException - if any index is out of the array's range
    • deleteAllByIndices

      @SafeVarargs public static String[] deleteAllByIndices(String[] a, int... indices) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the elements at the specified positions.
      The original array remains unchanged.
      Parameters:
      a - the input String array from which elements are to be removed
      indices - the positions of the elements to be removed
      Returns:
      a new String array containing the remaining elements after removal
      Throws:
      IndexOutOfBoundsException - if any index is out of the array's range
    • deleteAllByIndices

      @SafeVarargs public static <T> T[] deleteAllByIndices(@NotNull T[] a, int... indices) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the elements at the specified positions.
      The original array remains unchanged.
      Type Parameters:
      T - the type of elements in the input array
      Parameters:
      a - the input array from which elements are to be removed
      indices - the positions of the elements to be removed
      Returns:
      a new array containing the remaining elements after removal
      Throws:
      IndexOutOfBoundsException - if any index is out of the array's range
      IllegalArgumentException
    • deleteAllByIndices

      @SafeVarargs public static boolean deleteAllByIndices(@NotNull List<?> list, int... indices) throws IllegalArgumentException
      Deletes all elements at the specified positions from the given list.
      Parameters:
      list - The list from which elements are to be removed.
      indices - The positions of the elements to be removed.
      Returns:
      true if the list was modified as a result of the operation, false otherwise.
      Throws:
      IllegalArgumentException - if the input list is null.
    • remove

      public static boolean[] remove(boolean[] a, boolean valueToRemove)
      Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      A new array with the first occurrence of the specified value removed. An empty array is returned if the specified array is null or empty.
    • remove

      public static char[] remove(char[] a, char valueToRemove)
      Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      A new array with the first occurrence of the specified value removed. An empty array is returned if the specified array is null or empty.
    • remove

      public static byte[] remove(byte[] a, byte valueToRemove)
      Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      A new array with the first occurrence of the specified value removed. An empty array is returned if the specified array is null or empty.
    • remove

      public static short[] remove(short[] a, short valueToRemove)
      Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      A new array with the first occurrence of the specified value removed. An empty array is returned if the specified array is null or empty.
    • remove

      public static int[] remove(int[] a, int valueToRemove)
      Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      A new array with the first occurrence of the specified value removed. An empty array is returned if the specified array is null or empty.
    • remove

      public static long[] remove(long[] a, long valueToRemove)
      Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      A new array with the first occurrence of the specified value removed. An empty array is returned if the specified array is null or empty.
    • remove

      public static float[] remove(float[] a, float valueToRemove)
      Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      A new array with the first occurrence of the specified value removed. An empty array is returned if the specified array is null or empty.
    • remove

      public static double[] remove(double[] a, double valueToRemove)
      Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      A new array with the first occurrence of the specified value removed. An empty array is returned if the specified array is null or empty.
    • remove

      public static String[] remove(String[] a, String valueToRemove)
      Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      A new array with the first occurrence of the specified value removed. An empty array is returned if the specified array is null or empty.
    • remove

      @MayReturnNull public static <T> T[] remove(T[] a, T valueToRemove) throws IllegalArgumentException
      Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      A new array with the first occurrence of the specified value removed. The input array itself is returned if the specified array is null or empty.
      Throws:
      IllegalArgumentException
    • remove

      public static <T> boolean remove(Collection<T> c, T valueToRemove)
      Removes the first occurrence of the specified value from the given collection.
      Parameters:
      c - The collection from which the value should be removed.
      valueToRemove - The value to be removed from the collection.
      Returns:
      true if the collection changed as a result of this call, false otherwise.
    • removeAll

      @SafeVarargs public static boolean[] removeAll(boolean[] a, boolean... valuesToRemove)
      Returns a new array with elements copied from the specified array except all occurrences of the specified values.
      The original array remains unchanged.
      Parameters:
      a - The array from which the values should be removed.
      valuesToRemove - The values to be removed from the array.
      Returns:
      A new array with all occurrences of the specified values removed. An empty array is returned if the specified array is null or empty.
      See Also:
    • removeAll

      @SafeVarargs public static char[] removeAll(char[] a, char... valuesToRemove)
      Returns a new array with elements copied from the specified array except all occurrences of the specified values.
      The original array remains unchanged.
      Parameters:
      a - The array from which the values should be removed.
      valuesToRemove - The values to be removed from the array.
      Returns:
      A new array with all occurrences of the specified values removed. An empty array is returned if the specified array is null or empty.
      See Also:
    • removeAll

      @SafeVarargs public static byte[] removeAll(byte[] a, byte... valuesToRemove)
      Returns a new array with elements copied from the specified array except all occurrences of the specified values.
      The original array remains unchanged.
      Parameters:
      a - The array from which the values should be removed.
      valuesToRemove - The values to be removed from the array.
      Returns:
      A new array with all occurrences of the specified values removed. An empty array is returned if the specified array is null or empty.
      See Also:
    • removeAll

      @SafeVarargs public static short[] removeAll(short[] a, short... valuesToRemove)
      Returns a new array with elements copied from the specified array except all occurrences of the specified values.
      The original array remains unchanged.
      Parameters:
      a - The array from which the values should be removed.
      valuesToRemove - The values to be removed from the array.
      Returns:
      A new array with all occurrences of the specified values removed. An empty array is returned if the specified array is null or empty.
      See Also:
    • removeAll

      @SafeVarargs public static int[] removeAll(int[] a, int... valuesToRemove)
      Returns a new array with elements copied from the specified array except all occurrences of the specified values.
      The original array remains unchanged.
      Parameters:
      a - The array from which the values should be removed.
      valuesToRemove - The values to be removed from the array.
      Returns:
      A new array with all occurrences of the specified values removed. An empty array is returned if the specified array is null or empty.
      See Also:
    • removeAll

      @SafeVarargs public static long[] removeAll(long[] a, long... valuesToRemove)
      Returns a new array with elements copied from the specified array except all occurrences of the specified values.
      The original array remains unchanged.
      Parameters:
      a - The array from which the values should be removed.
      valuesToRemove - The values to be removed from the array.
      Returns:
      A new array with all occurrences of the specified values removed. An empty array is returned if the specified array is null or empty.
      See Also:
    • removeAll

      @SafeVarargs public static float[] removeAll(float[] a, float... valuesToRemove)
      Returns a new array with elements copied from the specified array except all occurrences of the specified values.
      The original array remains unchanged.
      Parameters:
      a - The array from which the values should be removed.
      valuesToRemove - The values to be removed from the array.
      Returns:
      A new array with all occurrences of the specified values removed. An empty array is returned if the specified array is null or empty.
      See Also:
    • removeAll

      @SafeVarargs public static double[] removeAll(double[] a, double... valuesToRemove)
      Returns a new array with elements copied from the specified array except all occurrences of the specified values.
      The original array remains unchanged.
      Parameters:
      a - The array from which the values should be removed.
      valuesToRemove - The values to be removed from the array.
      Returns:
      A new array with all occurrences of the specified values removed. An empty array is returned if the specified array is null or empty.
      See Also:
    • removeAll

      @SafeVarargs public static String[] removeAll(String[] a, String... valuesToRemove)
      Returns a new array with elements copied from the specified array except all occurrences of the specified values.
      The original array remains unchanged.
      Parameters:
      a - The array from which the values should be removed.
      valuesToRemove - The values to be removed from the array.
      Returns:
      A new array with all occurrences of the specified values removed. An empty array is returned if the specified array is null or empty.
      See Also:
    • removeAll

      @MayReturnNull @SafeVarargs public static <T> T[] removeAll(T[] a, T... valuesToRemove)
      Returns a new array with elements copied from the specified array except all occurrences of the specified values.
      The original array remains unchanged.
      Parameters:
      a - The array from which the values should be removed.
      valuesToRemove - The values to be removed from the array.
      Returns:
      A new array with the first occurrence of the specified value removed. The input array itself is returned if the specified array is null or empty.
      See Also:
    • removeAll

      @SafeVarargs public static <T> boolean removeAll(Collection<T> c, T... valuesToRemove)
      Removes all occurrences of the specified values from the given collection.
      Type Parameters:
      T - The type of elements in the collection.
      Parameters:
      c - The collection from which the values should be removed.
      valuesToRemove - The values to be removed from the collection.
      Returns:
      true if the collection changed as a result of this call, false otherwise.
    • removeAll

      public static <T> boolean removeAll(Collection<T> c, Iterable<?> valuesToRemove)
      Removes all occurrences of the specified values from the given collection.
      Type Parameters:
      T - The type of elements in the collection.
      Parameters:
      c - The collection from which the values should be removed.
      valuesToRemove - The collection of values to be removed from the collection.
      Returns:
      true if the collection changed as a result of this call, false otherwise.
    • removeAll

      public static <T> boolean removeAll(Collection<T> c, Iterator<?> valuesToRemove)
      Removes all occurrences of the specified values from the given collection.
      Type Parameters:
      T - The type of elements in the collection.
      Parameters:
      c - The collection from which the elements should be removed.
      valuesToRemove - The iterator of values to be removed from the collection.
      Returns:
      true if the collection changed as a result of this call, false otherwise.
    • removeAllOccurrences

      public static boolean[] removeAllOccurrences(boolean[] a, boolean valueToRemove)
      Returns a new array with elements copied from the specified array except all occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      a new array with all occurrences of the specified value removed. An empty array is returned if the specified array is null or empty.
    • removeAllOccurrences

      public static char[] removeAllOccurrences(char[] a, char valueToRemove)
      Returns a new array with elements copied from the specified array except all occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      a new array with all occurrences of the specified value removed. An empty array is returned if the specified array is null or empty.
    • removeAllOccurrences

      public static byte[] removeAllOccurrences(byte[] a, byte valueToRemove)
      Returns a new array with elements copied from the specified array except all occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      a new array with all occurrences of the specified value removed. An empty array is returned if the specified array is null or empty.
    • removeAllOccurrences

      public static short[] removeAllOccurrences(short[] a, short valueToRemove)
      Returns a new array with elements copied from the specified array except all occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      a new array with all occurrences of the specified value removed. An empty array is returned if the specified array is null or empty.
    • removeAllOccurrences

      public static int[] removeAllOccurrences(int[] a, int valueToRemove)
      Returns a new array with elements copied from the specified array except all occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      a new array with all occurrences of the specified value removed. An empty array is returned if the specified array is null or empty.
    • removeAllOccurrences

      public static long[] removeAllOccurrences(long[] a, long valueToRemove)
      Returns a new array with elements copied from the specified array except all occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      a new array with all occurrences of the specified value removed. An empty array is returned if the specified array is null or empty.
    • removeAllOccurrences

      public static float[] removeAllOccurrences(float[] a, float valueToRemove)
      Returns a new array with elements copied from the specified array except all occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      a new array with all occurrences of the specified value removed. An empty array is returned if the specified array is null or empty.
    • removeAllOccurrences

      public static double[] removeAllOccurrences(double[] a, double valueToRemove)
      Returns a new array with elements copied from the specified array except all occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      a new array with all occurrences of the specified value removed. An empty array is returned if the specified array is null or empty.
    • removeAllOccurrences

      public static String[] removeAllOccurrences(String[] a, String valueToRemove)
      Returns a new array with elements copied from the specified array except all occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      a new array with all occurrences of the specified value removed. An empty array is returned if the specified array is null or empty.
    • removeAllOccurrences

      public static <T> T[] removeAllOccurrences(T[] a, T valueToRemove)
      Returns a new array with elements copied from the specified array except all occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      a new array with all occurrences of the specified value removed. The input array itself is returned if the specified array is null or empty.
    • removeAllOccurrences

      public static <T> boolean removeAllOccurrences(Collection<T> c, T valueToRemove)
      Removes all occurrences of the specified value from the given collection.
      Type Parameters:
      T - The type of elements in the collection.
      Parameters:
      c - The collection from which the value should be removed.
      valueToRemove - The value to be removed from the collection.
      Returns:
      true if the collection changed as a result of this call, false otherwise.
    • removeDuplicates

      @Deprecated public static boolean[] removeDuplicates(boolean[] a)
      Deprecated.
      Use distinct(boolean[]) instead.
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      Returns:
      a new array with all duplicates removed. An empty array is returned if the specified array is null or empty.
    • removeDuplicates

      @Deprecated public static char[] removeDuplicates(char[] a)
      Deprecated.
      Use distinct(char[]) instead.
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      Returns:
      a new array with all duplicates removed. An empty array is returned if the specified array is null or empty.
    • removeDuplicates

      public static char[] removeDuplicates(char[] a, boolean isSorted)
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      isSorted - A boolean flag indicating whether the input array is sorted. If true, the algorithm will be faster
      Returns:
      a new array with all duplicates removed. An empty array is returned if the specified array is null or empty.
    • removeDuplicates

      public static char[] removeDuplicates(char[] a, int fromIndex, int toIndex, boolean isSorted) throws IndexOutOfBoundsException
      Returns a new array with distinct elements within the specified range.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      fromIndex - The initial index of the range to be considered for duplicate removal.
      toIndex - The final index of the range to be considered for duplicate removal.
      isSorted - A boolean flag indicating whether the input array within the specified range is sorted. If true, the algorithm will be faster.
      Returns:
      A new array with distinct elements within the specified range.
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds.
    • removeDuplicates

      @Deprecated public static byte[] removeDuplicates(byte[] a)
      Deprecated.
      Use distinct(byte[]) instead.
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      Returns:
      a new array with all duplicates removed. An empty array is returned if the specified array is null or empty.
    • removeDuplicates

      public static byte[] removeDuplicates(byte[] a, boolean isSorted)
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      isSorted - A boolean flag indicating whether the input array is sorted. If true, the algorithm will be faster
      Returns:
      a new array with all duplicates removed. An empty array is returned if the specified array is null or empty.
    • removeDuplicates

      public static byte[] removeDuplicates(byte[] a, int fromIndex, int toIndex, boolean isSorted) throws IndexOutOfBoundsException
      Returns a new array with distinct elements within the specified range.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      fromIndex - The initial index of the range to be considered for duplicate removal.
      toIndex - The final index of the range to be considered for duplicate removal.
      isSorted - A boolean flag indicating whether the input array within the specified range is sorted. If true, the algorithm will be faster.
      Returns:
      A new array with distinct elements within the specified range.
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds.
    • removeDuplicates

      @Deprecated public static short[] removeDuplicates(short[] a)
      Deprecated.
      Use distinct(short[]) instead.
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      Returns:
      a new array with all duplicates removed. An empty array is returned if the specified array is null or empty.
    • removeDuplicates

      public static short[] removeDuplicates(short[] a, boolean isSorted)
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      isSorted - A boolean flag indicating whether the input array is sorted. If true, the algorithm will be faster
      Returns:
      a new array with all duplicates removed. An empty array is returned if the specified array is null or empty.
    • removeDuplicates

      public static short[] removeDuplicates(short[] a, int fromIndex, int toIndex, boolean isSorted) throws IndexOutOfBoundsException
      Returns a new array with distinct elements within the specified range.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      fromIndex - The initial index of the range to be considered for duplicate removal.
      toIndex - The final index of the range to be considered for duplicate removal.
      isSorted - A boolean flag indicating whether the input array within the specified range is sorted. If true, the algorithm will be faster.
      Returns:
      A new array with distinct elements within the specified range.
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds.
    • removeDuplicates

      @Deprecated public static int[] removeDuplicates(int[] a)
      Deprecated.
      Use distinct(int[]) instead.
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      Returns:
      a new array with all duplicates removed. An empty array is returned if the specified array is null or empty.
    • removeDuplicates

      public static int[] removeDuplicates(int[] a, boolean isSorted)
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      isSorted - A boolean flag indicating whether the input array is sorted. If true, the algorithm will be faster
      Returns:
      a new array with all duplicates removed. An empty array is returned if the specified array is null or empty.
    • removeDuplicates

      public static int[] removeDuplicates(int[] a, int fromIndex, int toIndex, boolean isSorted) throws IndexOutOfBoundsException
      Returns a new array with distinct elements within the specified range.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      fromIndex - The initial index of the range to be considered for duplicate removal.
      toIndex - The final index of the range to be considered for duplicate removal.
      isSorted - A boolean flag indicating whether the input array within the specified range is sorted. If true, the algorithm will be faster.
      Returns:
      A new array with distinct elements within the specified range.
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds.
    • removeDuplicates

      @Deprecated public static long[] removeDuplicates(long[] a)
      Deprecated.
      Use distinct(long[]) instead.
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      Returns:
      a new array with all duplicates removed. An empty array is returned if the specified array is null or empty.
    • removeDuplicates

      public static long[] removeDuplicates(long[] a, boolean isSorted)
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      isSorted - A boolean flag indicating whether the input array is sorted. If true, the algorithm will be faster
      Returns:
      a new array with all duplicates removed. An empty array is returned if the specified array is null or empty.
    • removeDuplicates

      public static long[] removeDuplicates(long[] a, int fromIndex, int toIndex, boolean isSorted) throws IndexOutOfBoundsException
      Returns a new array with distinct elements within the specified range.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      fromIndex - The initial index of the range to be considered for duplicate removal.
      toIndex - The final index of the range to be considered for duplicate removal.
      isSorted - A boolean flag indicating whether the input array within the specified range is sorted. If true, the algorithm will be faster.
      Returns:
      A new array with distinct elements within the specified range.
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds.
    • removeDuplicates

      @Deprecated public static float[] removeDuplicates(float[] a)
      Deprecated.
      Use distinct(float[]) instead.
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      Returns:
      a new array with all duplicates removed. An empty array is returned if the specified array is null or empty.
    • removeDuplicates

      public static float[] removeDuplicates(float[] a, boolean isSorted)
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      isSorted - A boolean flag indicating whether the input array is sorted. If true, the algorithm will be faster
      Returns:
      a new array with all duplicates removed. An empty array is returned if the specified array is null or empty.
    • removeDuplicates

      public static float[] removeDuplicates(float[] a, int fromIndex, int toIndex, boolean isSorted) throws IndexOutOfBoundsException
      Returns a new array with distinct elements within the specified range.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      fromIndex - The initial index of the range to be considered for duplicate removal.
      toIndex - The final index of the range to be considered for duplicate removal.
      isSorted - A boolean flag indicating whether the input array within the specified range is sorted. If true, the algorithm will be faster.
      Returns:
      A new array with distinct elements within the specified range.
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds.
    • removeDuplicates

      @Deprecated public static double[] removeDuplicates(double[] a)
      Deprecated.
      Use distinct(double[]) instead.
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      Returns:
      a new array with all duplicates removed. An empty array is returned if the specified array is null or empty.
    • removeDuplicates

      public static double[] removeDuplicates(double[] a, boolean isSorted)
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      isSorted - A boolean flag indicating whether the input array is sorted. If true, the algorithm will be faster
      Returns:
      a new array with all duplicates removed. An empty array is returned if the specified array is null or empty.
    • removeDuplicates

      public static double[] removeDuplicates(double[] a, int fromIndex, int toIndex, boolean isSorted) throws IndexOutOfBoundsException
      Returns a new array with distinct elements within the specified range.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      fromIndex - The initial index of the range to be considered for duplicate removal.
      toIndex - The final index of the range to be considered for duplicate removal.
      isSorted - A boolean flag indicating whether the input array within the specified range is sorted. If true, the algorithm will be faster.
      Returns:
      A new array with distinct elements within the specified range.
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds.
    • removeDuplicates

      public static String[] removeDuplicates(String[] a)
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      Returns:
      a new array with all duplicates removed. An empty array is returned if the specified array is null or empty.
      See Also:
    • removeDuplicates

      public static String[] removeDuplicates(String[] a, boolean isSorted)
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      isSorted - A boolean flag indicating whether the input array is sorted. If true, the algorithm will be faster
      Returns:
      a new array with all duplicates removed. An empty array is returned if the specified array is null or empty.
    • removeDuplicates

      public static String[] removeDuplicates(String[] a, int fromIndex, int toIndex, boolean isSorted) throws IndexOutOfBoundsException
      Returns a new array with distinct elements within the specified range.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      fromIndex - The initial index of the range to be considered for duplicate removal.
      toIndex - The final index of the range to be considered for duplicate removal.
      isSorted - A boolean flag indicating whether the input array within the specified range is sorted. If true, the algorithm will be faster.
      Returns:
      A new array with distinct elements within the specified range.
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds.
    • removeDuplicates

      public static <T> T[] removeDuplicates(T[] a)
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      Returns:
      a new array with all duplicates removed. The input array itself is returned if the specified array is null or empty.
      See Also:
    • removeDuplicates

      public static <T> T[] removeDuplicates(T[] a, boolean isSorted)
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      isSorted - A boolean flag indicating whether the input array is sorted. If true, the algorithm will be faster
      Returns:
      a new array with all duplicates removed. The input array itself is returned if the specified array is null or empty.
    • removeDuplicates

      public static <T> T[] removeDuplicates(T[] a, int fromIndex, int toIndex, boolean isSorted) throws IndexOutOfBoundsException
      Returns a new array with distinct elements within the specified range.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      fromIndex - The initial index of the range to be considered for duplicate removal.
      toIndex - The final index of the range to be considered for duplicate removal.
      isSorted - A boolean flag indicating whether the input array within the specified range is sorted. If true, the algorithm will be faster.
      Returns:
      A new array with distinct elements within the specified range.
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds.
    • removeDuplicates

      public static boolean removeDuplicates(Collection<?> c)
      Removes duplicate elements from the given collection.
      Parameters:
      c - The collection from which duplicates should be removed.
      Returns:
      true if the collection changed as a result of this call, false otherwise.
      See Also:
    • removeDuplicates

      public static boolean removeDuplicates(Collection<?> c, boolean isSorted)
      Removes duplicate elements from the given collection.
      Parameters:
      c - The collection from which duplicates should be removed.
      isSorted - A boolean flag indicating whether the input array is sorted. If true, the algorithm will be faster
      Returns:
      true if the collection changed as a result of this call, false otherwise.
      See Also:
    • deleteRange

      public static boolean[] deleteRange(boolean[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a new array with the specified range of elements removed
      The original array remains unchanged.
      Parameters:
      a - the input array from which a range of elements are to be deleted
      fromIndex - the initial index of the range to be deleted, inclusive
      toIndex - the final index of the range to be deleted, exclusive
      Returns:
      a new array with the specified range of elements removed. An empty array is returned if the specified array is null or empty.
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
    • deleteRange

      public static char[] deleteRange(char[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a new array with the specified range of elements removed
      The original array remains unchanged.
      Parameters:
      a - the input array from which a range of elements are to be deleted
      fromIndex - the initial index of the range to be deleted, inclusive
      toIndex - the final index of the range to be deleted, exclusive
      Returns:
      a new array with the specified range of elements removed. An empty array is returned if the specified array is null or empty.
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
    • deleteRange

      public static byte[] deleteRange(byte[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a new array with the specified range of elements removed
      The original array remains unchanged.
      Parameters:
      a - the input array from which a range of elements are to be deleted
      fromIndex - the initial index of the range to be deleted, inclusive
      toIndex - the final index of the range to be deleted, exclusive
      Returns:
      a new array with the specified range of elements removed. An empty array is returned if the specified array is null or empty.
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
    • deleteRange

      public static short[] deleteRange(short[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a new array with the specified range of elements removed
      The original array remains unchanged.
      Parameters:
      a - the input array from which a range of elements are to be deleted
      fromIndex - the initial index of the range to be deleted, inclusive
      toIndex - the final index of the range to be deleted, exclusive
      Returns:
      a new array with the specified range of elements removed. An empty array is returned if the specified array is null or empty.
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
    • deleteRange

      public static int[] deleteRange(int[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a new array with the specified range of elements removed
      The original array remains unchanged.
      Parameters:
      a - the input array from which a range of elements are to be deleted
      fromIndex - the initial index of the range to be deleted, inclusive
      toIndex - the final index of the range to be deleted, exclusive
      Returns:
      a new array with the specified range of elements removed. An empty array is returned if the specified array is null or empty.
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
    • deleteRange

      public static long[] deleteRange(long[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a new array with the specified range of elements removed
      The original array remains unchanged.
      Parameters:
      a - the input array from which a range of elements are to be deleted
      fromIndex - the initial index of the range to be deleted, inclusive
      toIndex - the final index of the range to be deleted, exclusive
      Returns:
      a new array with the specified range of elements removed. An empty array is returned if the specified array is null or empty.
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
    • deleteRange

      public static float[] deleteRange(float[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a new array with the specified range of elements removed
      The original array remains unchanged.
      Parameters:
      a - the input array from which a range of elements are to be deleted
      fromIndex - the initial index of the range to be deleted, inclusive
      toIndex - the final index of the range to be deleted, exclusive
      Returns:
      a new array with the specified range of elements removed. An empty array is returned if the specified array is null or empty.
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
    • deleteRange

      public static double[] deleteRange(double[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a new array with the specified range of elements removed
      The original array remains unchanged.
      Parameters:
      a - the input array from which a range of elements are to be deleted
      fromIndex - the initial index of the range to be deleted, inclusive
      toIndex - the final index of the range to be deleted, exclusive
      Returns:
      a new array with the specified range of elements removed. An empty array is returned if the specified array is null or empty.
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
    • deleteRange

      public static String[] deleteRange(String[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException, IllegalArgumentException
      Returns a new array with the specified range of elements removed
      The original array remains unchanged.
      Parameters:
      a - the input array from which a range of elements are to be deleted
      fromIndex - the initial index of the range to be deleted, inclusive
      toIndex - the final index of the range to be deleted, exclusive
      Returns:
      a new array with the specified range of elements removed. An empty array is returned if the specified array is null or empty.
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
      IllegalArgumentException
    • deleteRange

      public static <T> T[] deleteRange(@NotNull T[] a, int fromIndex, int toIndex) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns a new array with the specified range of elements removed
      The original array remains unchanged.
      Parameters:
      a - the input array from which a range of elements are to be deleted
      fromIndex - the initial index of the range to be deleted, inclusive
      toIndex - the final index of the range to be deleted, exclusive
      Returns:
      a new array with the specified range of elements removed
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
      IllegalArgumentException
      See Also:
    • deleteRange

      public static <T> boolean deleteRange(List<T> c, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Deletes a range of elements from the given list.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      c - the input list from which a range of elements are to be deleted
      fromIndex - the initial index of the range to be deleted, inclusive
      toIndex - the final index of the range to be deleted, exclusive
      Returns:
      true if the list is updated; false otherwise
      Throws:
      IndexOutOfBoundsException - if the range is out of the list bounds
    • deleteRange

      public static String deleteRange(String str, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a new String with the specified range of chars removed
      The original String remains unchanged.
      Parameters:
      str - the input string from which a range of characters are to be deleted
      fromIndex - the initial index of the range to be deleted, inclusive
      toIndex - the final index of the range to be deleted, exclusive
      Returns:
      a new string with the specified range of characters deleted. An empty String is returned if the specified String is null or empty.
      Throws:
      IndexOutOfBoundsException - if the range is out of the string bounds
      See Also:
    • replaceRange

      public static boolean[] replaceRange(boolean[] a, int fromIndex, int toIndex, boolean[] replacement) throws IndexOutOfBoundsException
      Returns a new array with the specified range replaced with the replacement array.
      The original array remains unchanged.
      Parameters:
      a - the original array
      fromIndex - the initial index of the range to be replaced, inclusive
      toIndex - the final index of the range to be replaced, exclusive
      replacement - the array to replace the specified range in the original array
      Returns:
      a new array with the specified range replaced by the replacement array
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
    • replaceRange

      public static char[] replaceRange(char[] a, int fromIndex, int toIndex, char[] replacement) throws IndexOutOfBoundsException
      Returns a new array with the specified range replaced with the replacement array.
      The original array remains unchanged.
      Parameters:
      a - the original array
      fromIndex - the initial index of the range to be replaced, inclusive
      toIndex - the final index of the range to be replaced, exclusive
      replacement - the array to replace the specified range in the original array
      Returns:
      a new array with the specified range replaced by the replacement array
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
    • replaceRange

      public static byte[] replaceRange(byte[] a, int fromIndex, int toIndex, byte[] replacement) throws IndexOutOfBoundsException
      Returns a new array with the specified range replaced with the replacement array.
      The original array remains unchanged.
      Parameters:
      a - the original array
      fromIndex - the initial index of the range to be replaced, inclusive
      toIndex - the final index of the range to be replaced, exclusive
      replacement - the array to replace the specified range in the original array
      Returns:
      a new array with the specified range replaced by the replacement array
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
    • replaceRange

      public static short[] replaceRange(short[] a, int fromIndex, int toIndex, short[] replacement) throws IndexOutOfBoundsException
      Returns a new array with the specified range replaced with the replacement array.
      The original array remains unchanged.
      Parameters:
      a - the original array
      fromIndex - the initial index of the range to be replaced, inclusive
      toIndex - the final index of the range to be replaced, exclusive
      replacement - the array to replace the specified range in the original array
      Returns:
      a new array with the specified range replaced by the replacement array
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
    • replaceRange

      public static int[] replaceRange(int[] a, int fromIndex, int toIndex, int[] replacement) throws IndexOutOfBoundsException
      Returns a new array with the specified range replaced with the replacement array.
      The original array remains unchanged.
      Parameters:
      a - the original array
      fromIndex - the initial index of the range to be replaced, inclusive
      toIndex - the final index of the range to be replaced, exclusive
      replacement - the array to replace the specified range in the original array
      Returns:
      a new array with the specified range replaced by the replacement array
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
    • replaceRange

      public static long[] replaceRange(long[] a, int fromIndex, int toIndex, long[] replacement) throws IndexOutOfBoundsException
      Returns a new array with the specified range replaced with the replacement array.
      The original array remains unchanged.
      Parameters:
      a - the original array
      fromIndex - the initial index of the range to be replaced, inclusive
      toIndex - the final index of the range to be replaced, exclusive
      replacement - the array to replace the specified range in the original array
      Returns:
      a new array with the specified range replaced by the replacement array
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
    • replaceRange

      public static float[] replaceRange(float[] a, int fromIndex, int toIndex, float[] replacement) throws IndexOutOfBoundsException
      Returns a new array with the specified range replaced with the replacement array.
      The original array remains unchanged.
      Parameters:
      a - the original array
      fromIndex - the initial index of the range to be replaced, inclusive
      toIndex - the final index of the range to be replaced, exclusive
      replacement - the array to replace the specified range in the original array
      Returns:
      a new array with the specified range replaced by the replacement array
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
    • replaceRange

      public static double[] replaceRange(double[] a, int fromIndex, int toIndex, double[] replacement) throws IndexOutOfBoundsException
      Returns a new array with the specified range replaced with the replacement array.
      The original array remains unchanged.
      Parameters:
      a - the original array
      fromIndex - the initial index of the range to be replaced, inclusive
      toIndex - the final index of the range to be replaced, exclusive
      replacement - the array to replace the specified range in the original array
      Returns:
      a new array with the specified range replaced by the replacement array
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
    • replaceRange

      public static String[] replaceRange(String[] a, int fromIndex, int toIndex, String[] replacement) throws IndexOutOfBoundsException
      Returns a new array with the specified range replaced with the replacement array.
      The original array remains unchanged.
      Parameters:
      a - the original array
      fromIndex - the initial index of the range to be replaced, inclusive
      toIndex - the final index of the range to be replaced, exclusive
      replacement - the array to replace the specified range in the original array
      Returns:
      a new array with the specified range replaced by the replacement array
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
    • replaceRange

      public static <T> T[] replaceRange(@NotNull T[] a, int fromIndex, int toIndex, T[] replacement) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns a new array with the specified range replaced with the replacement array.
      The original array remains unchanged.
      Parameters:
      a - the original array
      fromIndex - the initial index of the range to be replaced, inclusive
      toIndex - the final index of the range to be replaced, exclusive
      replacement - the array to replace the specified range in the original array
      Returns:
      a new array with the specified range replaced by the replacement array
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
      IllegalArgumentException
    • replaceRange

      public static <T> boolean replaceRange(@NotNull List<T> c, int fromIndex, int toIndex, Collection<? extends T> replacement) throws IllegalArgumentException
      Replaces a range of elements in the given list with the elements from the replacement collection.
      Type Parameters:
      T - the type of elements in the list and replacement collection
      Parameters:
      c - the original list to be modified
      fromIndex - the initial index of the range to be replaced, inclusive
      toIndex - the final index of the range to be replaced, exclusive
      replacement - the collection to replace the specified range in the original list
      Returns:
      a boolean indicating whether the list was modified
      Throws:
      IndexOutOfBoundsException - if the range is out of the list bounds
      IllegalArgumentException
    • replaceRange

      public static String replaceRange(String str, int fromIndex, int toIndex, String replacement) throws IndexOutOfBoundsException
      Returns a new String with the specified range replaced with the replacement String.
      The original String remains unchanged.
      Parameters:
      str - the original string
      fromIndex - the initial index of the range to be replaced, inclusive
      toIndex - the final index of the range to be replaced, exclusive
      replacement - the string to replace the specified range in the original string
      Returns:
      a new string with the specified range replaced by the replacement string
      Throws:
      IndexOutOfBoundsException - if the range is out of the string bounds
      See Also:
    • moveRange

      public static void moveRange(boolean[] a, int fromIndex, int toIndex, int newPositionStartIndex) throws IndexOutOfBoundsException
      Moves a range of elements in the given array to a new position within the array.
      No elements are deleted in the process, the original array maintains its size.
      Parameters:
      a - the original array to be modified
      fromIndex - the initial index of the range to be moved, inclusive
      toIndex - the final index of the range to be moved, exclusive
      newPositionStartIndex - must in the range: [0, array.length - (toIndex - fromIndex)]
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds or newPositionStartIndex is invalid
    • moveRange

      public static void moveRange(char[] a, int fromIndex, int toIndex, int newPositionStartIndex) throws IndexOutOfBoundsException
      Moves a range of elements in the given array to a new position within the array.
      No elements are deleted in the process, the original array maintains its size.
      Parameters:
      a - the original array to be modified
      fromIndex - the initial index of the range to be moved, inclusive
      toIndex - the final index of the range to be moved, exclusive
      newPositionStartIndex - must in the range: [0, array.length - (toIndex - fromIndex)]
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds or newPositionStartIndex is invalid
    • moveRange

      public static void moveRange(byte[] a, int fromIndex, int toIndex, int newPositionStartIndex) throws IndexOutOfBoundsException
      Moves a range of elements in the given array to a new position within the array.
      No elements are deleted in the process, the original array maintains its size.
      Parameters:
      a - the original array to be modified
      fromIndex - the initial index of the range to be moved, inclusive
      toIndex - the final index of the range to be moved, exclusive
      newPositionStartIndex - must in the range: [0, array.length - (toIndex - fromIndex)]
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds or newPositionStartIndex is invalid
    • moveRange

      public static void moveRange(short[] a, int fromIndex, int toIndex, int newPositionStartIndex) throws IndexOutOfBoundsException
      Moves a range of elements in the given array to a new position within the array.
      No elements are deleted in the process, the original array maintains its size.
      Parameters:
      a - the original array to be modified
      fromIndex - the initial index of the range to be moved, inclusive
      toIndex - the final index of the range to be moved, exclusive
      newPositionStartIndex - must in the range: [0, array.length - (toIndex - fromIndex)]
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds or newPositionStartIndex is invalid
    • moveRange

      public static void moveRange(int[] a, int fromIndex, int toIndex, int newPositionStartIndex) throws IndexOutOfBoundsException
      Moves a range of elements in the given array to a new position within the array.
      No elements are deleted in the process, the original array maintains its size.
      Parameters:
      a - the original array to be modified
      fromIndex - the initial index of the range to be moved, inclusive
      toIndex - the final index of the range to be moved, exclusive
      newPositionStartIndex - must in the range: [0, array.length - (toIndex - fromIndex)]
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds or newPositionStartIndex is invalid
    • moveRange

      public static void moveRange(long[] a, int fromIndex, int toIndex, int newPositionStartIndex) throws IndexOutOfBoundsException
      Moves a range of elements in the given array to a new position within the array.
      No elements are deleted in the process, the original array maintains its size.
      Parameters:
      a - the original array to be modified
      fromIndex - the initial index of the range to be moved, inclusive
      toIndex - the final index of the range to be moved, exclusive
      newPositionStartIndex - must in the range: [0, array.length - (toIndex - fromIndex)]
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds or newPositionStartIndex is invalid
    • moveRange

      public static void moveRange(float[] a, int fromIndex, int toIndex, int newPositionStartIndex) throws IndexOutOfBoundsException
      Moves a range of elements in the given array to a new position within the array.
      No elements are deleted in the process, the original array maintains its size.
      Parameters:
      a - the original array to be modified
      fromIndex - the initial index of the range to be moved, inclusive
      toIndex - the final index of the range to be moved, exclusive
      newPositionStartIndex - must in the range: [0, array.length - (toIndex - fromIndex)]
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds or newPositionStartIndex is invalid
    • moveRange

      public static void moveRange(double[] a, int fromIndex, int toIndex, int newPositionStartIndex) throws IndexOutOfBoundsException
      Moves a range of elements in the given array to a new position within the array.
      No elements are deleted in the process, the original array maintains its size.
      Parameters:
      a - the original array to be modified
      fromIndex - the initial index of the range to be moved, inclusive
      toIndex - the final index of the range to be moved, exclusive
      newPositionStartIndex - must in the range: [0, array.length - (toIndex - fromIndex)]
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds or newPositionStartIndex is invalid
    • moveRange

      public static <T> void moveRange(T[] a, int fromIndex, int toIndex, int newPositionStartIndex) throws IndexOutOfBoundsException
      Moves a range of elements in the given array to a new position within the array.
      No elements are deleted in the process, the original array maintains its size.
      Parameters:
      a - the original array to be modified
      fromIndex - the initial index of the range to be moved, inclusive
      toIndex - the final index of the range to be moved, exclusive
      newPositionStartIndex - must in the range: [0, array.length - (toIndex - fromIndex)]
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds or newPositionStartIndex is invalid
    • moveRange

      public static <T> boolean moveRange(List<T> c, int fromIndex, int toIndex, int newPositionStartIndex) throws IndexOutOfBoundsException
      Moves a range of elements in the given list to a new position within the list.
      No elements are deleted in the process, the original list maintains its size.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      c - the original list to be modified
      fromIndex - the initial index of the range to be moved, inclusive
      toIndex - the final index of the range to be moved, exclusive
      newPositionStartIndex - must in the range: [0, list.size() - (toIndex - fromIndex)]
      Returns:
      true if the list was modified as a result of this operation
      Throws:
      IndexOutOfBoundsException - if the range is out of the list bounds or newPositionStartIndex is invalid
    • moveRange

      public static String moveRange(String str, int fromIndex, int toIndex, int newPositionStartIndex) throws IndexOutOfBoundsException
      Returns a new string with the specified range moved to the new position.
      The original String remains unchanged.
      Parameters:
      str - the original string to be modified
      fromIndex - the initial index of the range to be moved, inclusive
      toIndex - the final index of the range to be moved, exclusive
      newPositionStartIndex - must in the range: [0, String.length - (toIndex - fromIndex)]
      Returns:
      a new string with the specified range moved to the new position
      Throws:
      IndexOutOfBoundsException - if the range is out of the string bounds or newPositionStartIndex is invalid
      See Also:
    • skipRange

      public static <T> T[] skipRange(T[] a, int startInclusive, int endExclusive) throws IndexOutOfBoundsException
      Returns a new array with the specified range skipped.
      The original array remains unchanged.
      Type Parameters:
      T - the type of elements in the input array
      Parameters:
      a - the original array to be modified
      startInclusive - the initial index of the range to be skipped, inclusive
      endExclusive - the final index of the range to be skipped, exclusive
      Returns:
      a new array with the specified range skipped
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
      See Also:
    • skipRange

      public static <T> List<T> skipRange(Collection<? extends T> c, int startInclusive, int endExclusive) throws IndexOutOfBoundsException
      Returns a new list with the specified range skipped.
      The original collection remains unchanged.
      Type Parameters:
      T - the type of elements in the input collection
      Parameters:
      c - the original collection to be modified
      startInclusive - the initial index of the range to be skipped, inclusive
      endExclusive - the final index of the range to be skipped, exclusive
      Returns:
      a new list with the specified range skipped
      Throws:
      IndexOutOfBoundsException - if the range is out of the collection bounds
    • skipRange

      public static <T, C extends Collection<T>> C skipRange(Collection<? extends T> c, int startInclusive, int endExclusive, IntFunction<C> supplier) throws IndexOutOfBoundsException
      Returns a new collection with the specified range skipped.
      The original collection remains unchanged.
      Type Parameters:
      T - the type of elements in the input collection
      C - the type of the collection to be returned
      Parameters:
      c - the original collection to be modified
      startInclusive - the initial index of the range to be skipped, inclusive
      endExclusive - the final index of the range to be skipped, exclusive
      supplier - a function that creates a new instance of the desired collection type
      Returns:
      a new collection with the specified range skipped
      Throws:
      IndexOutOfBoundsException - if the range is out of the collection bounds
    • hasDuplicates

      public static boolean hasDuplicates(boolean[] a)
      Checks if the given array has duplicate elements.
      Parameters:
      a - the array to be checked for duplicates
      Returns:
      true if the array has duplicates, false otherwise
    • hasDuplicates

      public static boolean hasDuplicates(char[] a)
      Checks if the given array has duplicate elements.
      Parameters:
      a - the array to be checked for duplicates
      Returns:
      true if the array has duplicates, false otherwise
    • hasDuplicates

      public static boolean hasDuplicates(char[] a, boolean isSorted)
      Checks if the given array has duplicate elements.
      Parameters:
      a - the array to be checked for duplicates
      isSorted - a boolean that indicates if the array is sorted. If true, the algorithm will be faster.
      Returns:
      true if the array has duplicates, false otherwise
    • hasDuplicates

      public static boolean hasDuplicates(byte[] a)
      Checks if the given array has duplicate elements.
      Parameters:
      a - the array to be checked for duplicates
      Returns:
      true if the array has duplicates, false otherwise
    • hasDuplicates

      public static boolean hasDuplicates(byte[] a, boolean isSorted)
      Checks if the given array has duplicate elements.
      Parameters:
      a - the array to be checked for duplicates
      isSorted - a boolean that indicates if the array is sorted. If true, the algorithm will be faster.
      Returns:
      true if the array has duplicates, false otherwise
    • hasDuplicates

      public static boolean hasDuplicates(short[] a)
      Checks if the given array has duplicate elements.
      Parameters:
      a - the array to be checked for duplicates
      Returns:
      true if the array has duplicates, false otherwise
    • hasDuplicates

      public static boolean hasDuplicates(short[] a, boolean isSorted)
      Checks if the given array has duplicate elements.
      Parameters:
      a - the array to be checked for duplicates
      isSorted - a boolean that indicates if the array is sorted. If true, the algorithm will be faster.
      Returns:
      true if the array has duplicates, false otherwise
    • hasDuplicates

      public static boolean hasDuplicates(int[] a)
      Checks if the given array has duplicate elements.
      Parameters:
      a - the array to be checked for duplicates
      Returns:
      true if the array has duplicates, false otherwise
    • hasDuplicates

      public static boolean hasDuplicates(int[] a, boolean isSorted)
      Checks if the given array has duplicate elements.
      Parameters:
      a - the array to be checked for duplicates
      isSorted - a boolean that indicates if the array is sorted. If true, the algorithm will be faster.
      Returns:
      true if the array has duplicates, false otherwise
    • hasDuplicates

      public static boolean hasDuplicates(long[] a)
      Checks if the given array has duplicate elements.
      Parameters:
      a - the array to be checked for duplicates
      Returns:
      true if the array has duplicates, false otherwise
    • hasDuplicates

      public static boolean hasDuplicates(long[] a, boolean isSorted)
      Checks if the given array has duplicate elements.
      Parameters:
      a - the array to be checked for duplicates
      isSorted - a boolean that indicates if the array is sorted. If true, the algorithm will be faster.
      Returns:
      true if the array has duplicates, false otherwise
    • hasDuplicates

      public static boolean hasDuplicates(float[] a)
      Checks if the given array has duplicate elements.
      Parameters:
      a - the array to be checked for duplicates
      Returns:
      true if the array has duplicates, false otherwise
    • hasDuplicates

      public static boolean hasDuplicates(float[] a, boolean isSorted)
      Checks if the given array has duplicate elements.
      Parameters:
      a - the array to be checked for duplicates
      isSorted - a boolean that indicates if the array is sorted. If true, the algorithm will be faster.
      Returns:
      true if the array has duplicates, false otherwise
    • hasDuplicates

      public static boolean hasDuplicates(double[] a)
      Checks if the given array has duplicate elements.
      Parameters:
      a - the array to be checked for duplicates
      Returns:
      true if the array has duplicates, false otherwise
    • hasDuplicates

      public static boolean hasDuplicates(double[] a, boolean isSorted)
      Checks if the given array has duplicate elements.
      Parameters:
      a - the array to be checked for duplicates
      isSorted - a boolean that indicates if the array is sorted. If true, the algorithm will be faster.
      Returns:
      true if the array has duplicates, false otherwise
    • hasDuplicates

      public static <T> boolean hasDuplicates(T[] a)
      Checks if the given array has duplicate elements.
      Type Parameters:
      T -
      Parameters:
      a - the array to be checked for duplicates
      Returns:
      true if the array has duplicates, false otherwise
    • hasDuplicates

      public static <T> boolean hasDuplicates(T[] a, boolean isSorted)
      Checks if the given array has duplicate elements.
      Type Parameters:
      T -
      Parameters:
      a - the array to be checked for duplicates
      isSorted - a boolean that indicates if the array is sorted. If true, the algorithm will be faster.
      Returns:
      true if the array has duplicates, false otherwise
    • hasDuplicates

      public static boolean hasDuplicates(Collection<?> c)
      Checks if the given collection has duplicate elements.
      Parameters:
      c - the collection to be checked for duplicates
      Returns:
      true if the collection has duplicates, false otherwise
    • hasDuplicates

      public static boolean hasDuplicates(Collection<?> c, boolean isSorted)
      Checks if the given collection has duplicate elements.
      Parameters:
      c - the collection to be checked for duplicates
      isSorted - a boolean that indicates if the collection is sorted. If true, the algorithm will be faster
      Returns:
      true if the collection has duplicates, false otherwise
    • retainAll

      public static <T> boolean retainAll(Collection<T> c, Collection<? extends T> objsToKeep)
      Retains only the elements in the specified collection that are present in the specified collection of elements to keep. In other words, removes from the first collection all of its elements that are not contained in the second collection.
      Type Parameters:
      T - the type of elements in the input collections
      Parameters:
      c - the collection to be modified.
      objsToKeep - the collection containing elements to be retained in the first collection.
      Returns:
      true if the first collection changed as a result of the call
      See Also:
    • sum

      @SafeVarargs public static int sum(char... a)
      Sums all elements in the given array of characters.
      Parameters:
      a - The array of characters to be summed.
      Returns:
      The sum of all characters in the array. If the array is null or empty, 0 is returned.
    • sum

      public static int sum(char[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Sums all elements within the specified range in the input array of characters
      Parameters:
      a - The array of characters to be summed.
      fromIndex - The starting index (inclusive) of the range to be summed.
      toIndex - The ending index (exclusive) of the range to be summed.
      Returns:
      The sum of all elements within the specified range in the input array. If the array is null or empty, 0 is returned.
      Throws:
      IndexOutOfBoundsException - If the specified range is out of bounds for the given array.
    • sum

      @SafeVarargs public static int sum(byte... a)
      Sums all elements in the given array of bytes.
      Parameters:
      a - The array of bytes to be summed.
      Returns:
      The sum of all bytes in the array. If the array is null or empty, 0 is returned.
    • sum

      public static int sum(byte[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Sums all elements within the specified range in the input array of bytes
      Parameters:
      a - The array of bytes to be summed.
      fromIndex - The starting index (inclusive) of the range to be summed.
      toIndex - The ending index (exclusive) of the range to be summed.
      Returns:
      The sum of all elements within the specified range in the input array. If the array is null or empty, 0 is returned.
      Throws:
      IndexOutOfBoundsException - If the specified range is out of bounds for the given array.
    • sum

      @SafeVarargs public static int sum(short... a)
      Sums all elements in the given array of shorts.
      Parameters:
      a - The array of shorts to be summed.
      Returns:
      The sum of all shorts in the array. If the array is null or empty, 0 is returned.
    • sum

      public static int sum(short[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Sums all elements within the specified range in the input array of shorts
      Parameters:
      a - The array of shorts to be summed.
      fromIndex - The starting index (inclusive) of the range to be summed.
      toIndex - The ending index (exclusive) of the range to be summed.
      Returns:
      The sum of all elements within the specified range in the input array. If the array is null or empty, 0 is returned.
      Throws:
      IndexOutOfBoundsException - If the specified range is out of bounds for the given array.
    • sum

      @SafeVarargs public static int sum(int... a)
      Sums all elements in the given array of ints.
      Parameters:
      a - The array of ints to be summed.
      Returns:
      The sum of all ints in the array. If the array is null or empty, 0 is returned
    • sum

      public static int sum(int[] a, int fromIndex, int toIndex)
      Sums all elements within the specified range in the input array of ints
      Parameters:
      a - The array of ints to be summed.
      fromIndex - The starting index (inclusive) of the range to be summed.
      toIndex - The ending index (exclusive) of the range to be summed.
      Returns:
      The sum of all elements within the specified range in the input array. If the array is null or empty, 0 is returned.
      Throws:
      IndexOutOfBoundsException - If the specified range is out of bounds for the given array.
    • sumToLong

      @SafeVarargs public static long sumToLong(int... a)
      Sums all elements in the given array of ints to a long value.
      Parameters:
      a - The array of longs to be summed.
      Returns:
      The sum of all ints in the array. If the array is null or empty, 0 is returned.
    • sumToLong

      public static long sumToLong(int[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Sums all elements within the specified range in the input array of ints to a long value.
      Parameters:
      a - The array of ints to be summed.
      fromIndex - The starting index (inclusive) of the range to be summed.
      toIndex - The ending index (exclusive) of the range to be summed.
      Returns:
      The sum of all elements within the specified range in the input array. If the array is null or empty, 0 is returned.
      Throws:
      IndexOutOfBoundsException - If the specified range is out of bounds for the given array.
    • sum

      @SafeVarargs public static long sum(long... a)
      Sums all elements in the given array of longs.
      Parameters:
      a - The array of longs to be summed.
      Returns:
      The sum of all longs in the array. If the array is null or empty, 0 is returned.
    • sum

      public static long sum(long[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Sums all elements within the specified range in the input array of longs
      Parameters:
      a - The array of longs to be summed.
      fromIndex - The starting index (inclusive) of the range to be summed.
      toIndex - The ending index (exclusive) of the range to be summed.
      Returns:
      The sum of all elements within the specified range in the input array. If the array is null or empty, 0 is returned.
      Throws:
      IndexOutOfBoundsException - If the specified range is out of bounds for the given array.
    • sum

      @SafeVarargs public static float sum(float... a)
      Sums all elements in the given array of floats.
      Parameters:
      a - The array of floats to be summed.
      Returns:
      The sum of all floats in the array. If the array is null or empty, 0 is returned.
    • sum

      public static float sum(float[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Sums all elements within the specified range in the input array of floats
      Parameters:
      a - The array of floats to be summed.
      fromIndex - The starting index (inclusive) of the range to be summed.
      toIndex - The ending index (exclusive) of the range to be summed.
      Returns:
      The sum of all elements within the specified range in the input array. If the array is null or empty, 0 is returned.
      Throws:
      IndexOutOfBoundsException - If the specified range is out of bounds for the given array.
    • sumToDouble

      @SafeVarargs public static double sumToDouble(float... a)
      Sums all elements in the given array of floats to a double value.
      Parameters:
      a - The array of floats to be summed.
      Returns:
      The sum of all floats in the array. If the array is null or empty, 0 is returned.
    • sumToDouble

      public static double sumToDouble(float[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Sums all elements within the specified range in the input array of floats to a double value.
      Parameters:
      a - The array of floats to be summed.
      fromIndex - The starting index (inclusive) of the range to be summed.
      toIndex - The ending index (exclusive) of the range to be summed.
      Returns:
      The sum of all elements within the specified range in the input array. If the array is null or empty, 0 is returned.
      Throws:
      IndexOutOfBoundsException - If the specified range is out of bounds for the given array.
    • sum

      @SafeVarargs public static double sum(double... a)
      Sums all elements in the given array of doubles.
      Parameters:
      a - The array of doubles to be summed.
      Returns:
      The sum of all doubles in the array. If the array is null or empty, 0 is returned.
    • sum

      public static double sum(double[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Sums all elements within the specified range in the input array of doubles
      Parameters:
      a - The array of doubles to be summed.
      fromIndex - The starting index (inclusive) of the range to be summed.
      toIndex - The ending index (exclusive) of the range to be summed.
      Returns:
      The sum of all elements within the specified range in the input array. If the array is null or empty, 0 is returned.
      Throws:
      IndexOutOfBoundsException - If the specified range is out of bounds for the given array.
    • average

      @SafeVarargs public static double average(char... a)
      Calculates the average of all elements in the given array of characters.
      Parameters:
      a - The array of characters to be averaged.
      Returns:
      The average of all characters in the array. If the array is null or empty, 0 is returned.
    • average

      public static double average(char[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Calculates the average of all elements within the specified range in the given array of characters.
      Parameters:
      a - The array of characters to be averaged.
      fromIndex - The starting index, inclusive.
      toIndex - The ending index, exclusive.
      Returns:
      The average of all characters in the specified range of the array. If the specified range is empty, 0 is returned.
      Throws:
      IndexOutOfBoundsException - If the specified range is out of bounds.
    • average

      @SafeVarargs public static double average(byte... a)
      Calculates the average of all elements in the given array of bytes.
      Parameters:
      a - The array of bytes to be averaged.
      Returns:
      The average of all bytes in the array. If the array is null or empty, 0 is returned.
    • average

      public static double average(byte[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Calculates the average of all elements within the specified range in the given array of bytes.
      Parameters:
      a - The array of bytes to be averaged.
      fromIndex - The starting index, inclusive.
      toIndex - The ending index, exclusive.
      Returns:
      The average of all bytes in the specified range of the array. If the specified range is empty, 0 is returned.
      Throws:
      IndexOutOfBoundsException - If the specified range is out of bounds.
    • average

      @SafeVarargs public static double average(short... a)
      Calculates the average of all elements in the given array of shorts.
      Parameters:
      a - The array of shorts to be averaged.
      Returns:
      The average of all shorts in the array. If the array is null or empty, 0 is returned.
    • average

      public static double average(short[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Calculates the average of all elements within the specified range in the given array of shorts.
      Parameters:
      a - The array of shorts to be averaged.
      fromIndex - The starting index, inclusive.
      toIndex - The ending index, exclusive.
      Returns:
      The average of all shorts in the specified range of the array. If the specified range is empty, 0 is returned.
      Throws:
      IndexOutOfBoundsException - If the specified range is out of bounds.
    • average

      @SafeVarargs public static double average(int... a)
      Calculates the average of all elements in the given array of ints.
      Parameters:
      a - The array of ints to be averaged.
      Returns:
      The average of all ints in the array. If the array is null or empty, 0 is returned.
    • average

      public static double average(int[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Calculates the average of all elements within the specified range in the given array of ints.
      Parameters:
      a - The array of ints to be averaged.
      fromIndex - The starting index, inclusive.
      toIndex - The ending index, exclusive.
      Returns:
      The average of all ints in the specified range of the array. If the specified range is empty, 0 is returned.
      Throws:
      IndexOutOfBoundsException - If the specified range is out of bounds.
    • average

      @SafeVarargs public static double average(long... a)
      Calculates the average of all elements in the given array of longs.
      Parameters:
      a - The array of longs to be averaged.
      Returns:
      The average of all longs in the array. If the array is null or empty, 0 is returned.
    • average

      public static double average(long[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Calculates the average of all elements within the specified range in the given array of longs.
      Parameters:
      a - The array of longs to be averaged.
      fromIndex - The starting index, inclusive.
      toIndex - The ending index, exclusive.
      Returns:
      The average of all longs in the specified range of the array. If the specified range is empty, 0 is returned.
      Throws:
      IndexOutOfBoundsException - If the specified range is out of bounds.
    • average

      @SafeVarargs public static double average(float... a)
      Calculates the average of all elements in the given array of floats.
      Parameters:
      a - The array of floats to be averaged.
      Returns:
      The average of all floats in the array. If the array is null or empty, 0 is returned.
    • average

      public static double average(float[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Calculates the average of all elements within the specified range in the given array of floats.
      Parameters:
      a - The array of floats to be averaged.
      fromIndex - The starting index, inclusive.
      toIndex - The ending index, exclusive.
      Returns:
      The average of all floats in the specified range of the array. If the specified range is empty, 0 is returned.
      Throws:
      IndexOutOfBoundsException - If the specified range is out of bounds.
    • average

      @SafeVarargs public static double average(double... a)
      Calculates the average of all elements in the given array of doubles.
      Parameters:
      a - The array of doubles to be averaged.
      Returns:
      The average of all doubles in the array. If the array is null or empty, 0 is returned
    • average

      public static double average(double[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Calculates the average of all elements within the specified range in the given array of doubles.
      Parameters:
      a - The array of doubles to be averaged.
      fromIndex - The starting index, inclusive.
      toIndex - The ending index, exclusive.
      Returns:
      The average of all doubles in the specified range of the array. If the specified range is empty, 0 is returned.
      Throws:
      IndexOutOfBoundsException - If the specified range is out of bounds.
    • sumInt

      public static <T extends Number> int sumInt(T[] a)
      Sums all elements in the given array of numbers and returns the result as an integer.
      Type Parameters:
      T - The type of the elements in the array, which must extend Number.
      Parameters:
      a - The array of numbers to be summed.
      Returns:
      The sum of all elements in the array as an integer.
      See Also:
    • sumInt

      public static <T extends Number> int sumInt(T[] a, int fromIndex, int toIndex)
      Sums all elements within the specified range in the input array of numbers and returns the result as an integer.
      Type Parameters:
      T - The type of the elements in the array, which must extend Number.
      Parameters:
      a - The array of numbers to be summed.
      fromIndex - The starting index (inclusive) of the range to be summed.
      toIndex - The ending index (exclusive) of the range to be summed.
      Returns:
      The sum of all elements within the specified range in the array as an integer.
      Throws:
      IndexOutOfBoundsException - If the specified range is out of bounds for the given array.
      See Also:
    • sumInt

      public static <T> int sumInt(T[] a, ToIntFunction<? super T> func) throws IndexOutOfBoundsException
      Sums all elements in the given array using the provided function to convert each element to an integer.
      Type Parameters:
      T - The type of the elements in the array.
      Parameters:
      a - The array of elements to be summed.
      func - The function to convert each element to an integer.
      Returns:
      The sum of all elements in the array as an integer.
      Throws:
      IndexOutOfBoundsException
      See Also:
    • sumInt

      public static <T> int sumInt(T[] a, int fromIndex, int toIndex, ToIntFunction<? super T> func) throws IndexOutOfBoundsException
      Sums all elements within the specified range in the input array using the provided function to convert each element to an integer.
      Type Parameters:
      T - The type of the elements in the array.
      Parameters:
      a - The array of elements to be summed.
      fromIndex - The starting index (inclusive) of the range to be summed.
      toIndex - The ending index (exclusive) of the range to be summed.
      func - The function to convert each element to an integer.
      Returns:
      The sum of all elements within the specified range of the array as an integer.
      Throws:
      IndexOutOfBoundsException - If the specified range is out of bounds.
      See Also:
    • sumInt

      public static <T extends Number> int sumInt(Collection<? extends T> c, int fromIndex, int toIndex)
      Sums all elements within the specified range in the input collection of numbers and returns the result as an integer.
      Type Parameters:
      T - The type of the elements in the collection, which must extend Number.
      Parameters:
      c - The collection of numbers to be summed.
      fromIndex - The starting index (inclusive) of the range to be summed.
      toIndex - The ending index (exclusive) of the range to be summed.
      Returns:
      The sum of all elements within the specified range in the collection as an integer.
      Throws:
      IndexOutOfBoundsException - If the specified range is out of bounds for the given collection.
      See Also:
    • sumInt

      public static <T> int sumInt(Collection<? extends T> c, int fromIndex, int toIndex, ToIntFunction<? super T> func) throws IndexOutOfBoundsException
      Sums all elements within the specified range in the input collection using the provided function to convert each element to an integer.
      Type Parameters:
      T - The type of the elements in the collection.
      Parameters:
      c - The collection of elements to be summed.
      fromIndex - The starting index (inclusive) of the range to be summed.
      toIndex - The ending index (exclusive) of the range to be summed.
      func - The function to convert each element to an integer.
      Returns:
      The sum of all elements within the specified range of the collection as an integer.
      Throws:
      IndexOutOfBoundsException - If the specified range is out of bounds.
      See Also:
    • sumInt

      public static <T extends Number> int sumInt(Iterable<? extends T> c)
      Sums all elements in the given iterable of numbers and returns the result as a integer.
      Type Parameters:
      T - The type of the elements in the iterable, which must extend Number.
      Parameters:
      c - The iterable of elements to be summed.
      Returns:
      The sum of all elements in the iterable as a integer.
      See Also:
    • sumInt

      public static <T> int sumInt(Iterable<? extends T> c, ToIntFunction<? super T> func)
      Sums all elements in the given iterable using the provided function to convert each element to an integer.
      Type Parameters:
      T - The type of the elements in the iterable.
      Parameters:
      c - The iterable of elements to be summed.
      func - The function to convert each element to an integer.
      Returns:
      The sum of all elements in the iterable as an integer.
      See Also:
    • sumIntToLong

      public static <T extends Number> long sumIntToLong(Iterable<? extends T> c)
      Sums all elements in the given iterable of numbers and returns the result as a long.
      Type Parameters:
      T - The type of the elements in the iterable, which must extend Number.
      Parameters:
      c - The iterable of numbers to be summed.
      Returns:
      The sum of all elements in the iterable as a long.
      See Also:
    • sumIntToLong

      public static <T> long sumIntToLong(Iterable<? extends T> c, ToIntFunction<? super T> func)
      Sums all elements in the given iterable using the provided function to convert each element to an integer and returns the result as a long.
      Type Parameters:
      T - The type of the elements in the iterable.
      Parameters:
      c - The iterable of elements to be summed.
      func - The function to convert each element to an integer.
      Returns:
      The sum of all elements in the iterable as a long.
      See Also:
    • sumLong

      public static <T extends Number> long sumLong(T[] a)
      Sums all elements in the given array of numbers and returns the result as a long.
      Type Parameters:
      T - The type of the elements in the array, which must extend Number.
      Parameters:
      a - The array of numbers to be summed.
      Returns:
      The sum of all elements in the array as a long.
      See Also:
    • sumLong

      public static <T extends Number> long sumLong(T[] a, int fromIndex, int toIndex)
      Sums all elements within the specified range in the input array of numbers and returns the result as a long.
      Type Parameters:
      T - The type of the elements in the array, which must extend Number.
      Parameters:
      a - The array of numbers to be summed.
      fromIndex - The starting index (inclusive) of the range to be summed.
      toIndex - The ending index (exclusive) of the range to be summed.
      Returns:
      The sum of all elements within the specified range in the array as a long.
      Throws:
      IndexOutOfBoundsException - If the specified range is out of bounds for the given array.
      See Also:
    • sumLong

      public static <T> long sumLong(T[] a, ToLongFunction<? super T> func) throws IndexOutOfBoundsException
      Sums all elements in the given array using the provided function to convert each element to a long.
      Type Parameters:
      T - The type of the elements in the array.
      Parameters:
      a - The array of elements to be summed.
      func - The function to convert each element to a long.
      Returns:
      The sum of all elements in the array as a long.
      Throws:
      IndexOutOfBoundsException
      See Also:
    • sumLong

      public static <T> long sumLong(T[] a, int fromIndex, int toIndex, ToLongFunction<? super T> func) throws IndexOutOfBoundsException
      Sums all elements within the specified range in the input array using the provided function to convert each element to a long.
      Type Parameters:
      T - The type of the elements in the array.
      Parameters:
      a - The array of elements to be summed.
      fromIndex - The starting index (inclusive) of the range to be summed.
      toIndex - The ending index (exclusive) of the range to be summed.
      func - The function to convert each element to a long.
      Returns:
      The sum of all elements within the specified range of the array as a long.
      Throws:
      IndexOutOfBoundsException - If the specified range is out of bounds.
      See Also:
    • sumLong

      public static <T extends Number> long sumLong(Collection<? extends T> c, int fromIndex, int toIndex)
      Sums all elements within the specified range in the input collection of numbers and returns the result as an long.
      Type Parameters:
      T - The type of the elements in the collection, which must extend Number.
      Parameters:
      c - The collection of numbers to be summed.
      fromIndex - The starting index (inclusive) of the range to be summed.
      toIndex - The ending index (exclusive) of the range to be summed.
      Returns:
      The sum of all elements within the specified range in the collection as an long.
      Throws:
      IndexOutOfBoundsException - If the specified range is out of bounds for the given collection.
      See Also:
    • sumLong

      public static <T> long sumLong(Collection<? extends T> c, int fromIndex, int toIndex, ToLongFunction<? super T> func) throws IndexOutOfBoundsException
      Sums all elements within the specified range in the input collection using the provided function to convert each element to a long.
      Type Parameters:
      T - The type of the elements in the collection.
      Parameters:
      c - The collection of elements to be summed.
      fromIndex - The starting index (inclusive) of the range to be summed.
      toIndex - The ending index (exclusive) of the range to be summed.
      func - The function to convert each element to a long.
      Returns:
      The sum of all elements within the specified range of the collection as a long.
      Throws:
      IndexOutOfBoundsException - If the specified range is out of bounds.
      See Also:
    • sumLong

      public static <T extends Number> long sumLong(Iterable<? extends T> c)
      Sums all elements in the given iterable of numbers and returns the result as a long.
      Type Parameters:
      T - The type of the elements in the iterable, which must extend Number.
      Parameters:
      c - The iterable of numbers to be summed.
      Returns:
      The sum of all elements in the iterable as a long.
      See Also:
    • sumLong

      public static <T> long sumLong(Iterable<? extends T> c, ToLongFunction<? super T> func)
      Sums all elements in the given iterable using the provided function to convert each element to a long.
      Type Parameters:
      T - The type of the elements in the iterable.
      Parameters:
      c - The iterable of elements to be summed.
      func - The function to convert each element to a long.
      Returns:
      The sum of all elements in the iterable as a long.
      See Also:
    • sumDouble

      public static <T extends Number> double sumDouble(T[] a)
      Sums all elements in the given array of numbers and returns the result as a double.
      Type Parameters:
      T - The type of the elements in the array, which must extend Number.
      Parameters:
      a - The array of numbers to be summed.
      Returns:
      The sum of all elements in the array as a double.
      See Also:
    • sumDouble

      public static <T extends Number> double sumDouble(T[] a, int fromIndex, int toIndex)
      Sums all elements within the specified range in the input array of numbers and returns the result as a double.
      Type Parameters:
      T - The type of the elements in the array, which must extend Number.
      Parameters:
      a - The array of numbers to be summed.
      fromIndex - The starting index (inclusive) of the range to be summed.
      toIndex - The ending index (exclusive) of the range to be summed.
      Returns:
      The sum of all elements within the specified range in the array as a double.
      Throws:
      IndexOutOfBoundsException - If the specified range is out of bounds for the given array.
      See Also:
    • sumDouble

      public static <T> double sumDouble(T[] a, ToDoubleFunction<? super T> func)
      Sums all elements in the given array using the provided function to convert each element to a double.
      Type Parameters:
      T - The type of the elements in the array.
      Parameters:
      a - The array of elements to be summed.
      func - The function to convert each element to a double.
      Returns:
      The sum of all elements in the array as a double.
      See Also:
    • sumDouble

      public static <T> double sumDouble(T[] a, int fromIndex, int toIndex, ToDoubleFunction<? super T> func) throws IndexOutOfBoundsException
      Sums all elements within the specified range in the input array using the provided function to convert each element to a double.
      Type Parameters:
      T - The type of the elements in the array.
      Parameters:
      a - The array of elements to be summed.
      fromIndex - The starting index (inclusive) of the range to be summed.
      toIndex - The ending index (exclusive) of the range to be summed.
      func - The function to convert each element to a double.
      Returns:
      The sum of all elements within the specified range of the array as a double.
      Throws:
      IndexOutOfBoundsException - If the specified range is out of bounds.
      See Also:
    • sumDouble

      public static <T extends Number> double sumDouble(Collection<? extends T> c, int fromIndex, int toIndex)
      Sums all elements within the specified range in the input collection of numbers and returns the result as an double.
      Type Parameters:
      T - The type of the elements in the collection, which must extend Number.
      Parameters:
      c - The collection of numbers to be summed.
      fromIndex - The starting index (inclusive) of the range to be summed.
      toIndex - The ending index (exclusive) of the range to be summed.
      Returns:
      The sum of all elements within the specified range in the collection as an double.
      Throws:
      IndexOutOfBoundsException - If the specified range is out of bounds for the given collection.
      See Also:
    • sumDouble

      public static <T> double sumDouble(Collection<? extends T> c, int fromIndex, int toIndex, ToDoubleFunction<? super T> func) throws IndexOutOfBoundsException
      Sums all elements within the specified range in the input collection using the provided function to convert each element to a double.
      Type Parameters:
      T - The type of the elements in the collection.
      Parameters:
      c - The collection of elements to be summed.
      fromIndex - The starting index (inclusive) of the range to be summed.
      toIndex - The ending index (exclusive) of the range to be summed.
      func - The function to convert each element to a double.
      Returns:
      The sum of all elements within the specified range of the collection as a double.
      Throws:
      IndexOutOfBoundsException - If the specified range is out of bounds.
      See Also:
    • sumDouble

      public static <T extends Number> double sumDouble(Iterable<? extends T> c)
      Sums all elements in the given iterable of numbers and returns the result as a double.
      Type Parameters:
      T - The type of the elements in the iterable, which must extend Number.
      Parameters:
      c - The iterable of numbers to be summed.
      Returns:
      The sum of all elements in the iterable as a double.
      See Also:
    • sumDouble

      public static <T> double sumDouble(Iterable<? extends T> c, ToDoubleFunction<? super T> func)
      Sums all elements in the given iterable using the provided function to convert each element to a double.
      Type Parameters:
      T - The type of the elements in the iterable.
      Parameters:
      c - The iterable of elements to be summed.
      func - The function to convert each element to a double.
      Returns:
      The sum of all elements in the iterable as a double.
      See Also:
    • sumBigInteger

      public static BigInteger sumBigInteger(Iterable<? extends BigInteger> c)
      Sums all elements in the given iterable of BigInteger and returns the result as a BigInteger.
      Parameters:
      c - The iterable of BigInteger elements to be summed.
      Returns:
      The sum of all elements in the iterable as a BigInteger.
      See Also:
    • sumBigInteger

      public static <T> BigInteger sumBigInteger(Iterable<? extends T> c, Function<? super T,BigInteger> func)
      Sums all elements in the given iterable using the provided function to convert each element to a BigInteger.
      Type Parameters:
      T - The type of elements in the iterable.
      Parameters:
      c - The iterable of elements to be summed.
      func - The function to convert each element to a BigInteger.
      Returns:
      The sum of all elements in the iterable as a BigInteger.
      See Also:
    • sumBigDecimal

      public static BigDecimal sumBigDecimal(Iterable<? extends BigDecimal> c)
      Sums all elements in the given iterable of BigDecimal and returns the result as a BigDecimal.
      Parameters:
      c - The iterable of BigDecimal elements to be summed.
      Returns:
      The sum of all elements in the iterable as a BigDecimal.
      See Also:
    • sumBigDecimal

      public static <T> BigDecimal sumBigDecimal(Iterable<? extends T> c, Function<? super T,BigDecimal> func)
      Sums all elements in the given iterable using the provided function to convert each element to a BigDecimal.
      Type Parameters:
      T - The type of elements in the iterable.
      Parameters:
      c - The iterable of elements to be summed.
      func - The function to convert each element to a BigDecimal.
      Returns:
      The sum of all elements in the iterable as a BigDecimal.
      See Also:
    • averageInt

      public static <T extends Number> double averageInt(T[] a)
      Calculates the average of the elements in the given array of numbers.
      Type Parameters:
      T - The type of the elements in the array, which must extend Number.
      Parameters:
      a - The array of numbers to calculate the average.
      Returns:
      The average of the elements in the array as a double.
      See Also:
    • averageInt

      public static <T extends Number> double averageInt(T[] a, int fromIndex, int toIndex)
      Calculates the average of the elements in the given array of numbers within the specified range.
      Type Parameters:
      T - The type of the elements in the array, which must extend Number.
      Parameters:
      a - The array of numbers to calculate the average.
      fromIndex - The starting index (inclusive) of the range.
      toIndex - The ending index (exclusive) of the range.
      Returns:
      The average of the elements within the specified range as a double.
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds.
      See Also:
    • averageInt

      public static <T> double averageInt(T[] a, ToIntFunction<? super T> func)
      Calculates the average of the elements in the given array using the provided function to convert each element to an integer.
      Type Parameters:
      T - The type of the elements in the array
      Parameters:
      a - The array of numbers to calculate the average.
      func - The function to convert each element to an integer.
      Returns:
      The average of the elements in the array as a double.
      See Also:
    • averageInt

      public static <T> double averageInt(T[] a, int fromIndex, int toIndex, ToIntFunction<? super T> func) throws IndexOutOfBoundsException
      Calculates the average of the elements within the specified range in the input array using the provided function to convert each element to an integer.
      Type Parameters:
      T - The type of the elements in the array
      Parameters:
      a - The array to calculate the average.
      fromIndex - The starting index (inclusive) of the range.
      toIndex - The ending index (exclusive) of the range.
      func - The function to convert each element to an integer.
      Returns:
      The average of the elements within the specified range as a double.
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds.
      See Also:
    • averageInt

      public static <T extends Number> double averageInt(Collection<? extends T> c, int fromIndex, int toIndex)
      Calculates the average of the elements within the specified range in the input collection of numbers.
      Type Parameters:
      T - The type of the elements in the collection, which must extend Number.
      Parameters:
      c - The collection of numbers to calculate the average.
      fromIndex - The starting index (inclusive) of the range.
      toIndex - The ending index (exclusive) of the range.
      Returns:
      The average of the elements within the specified range as a double.
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds.
      See Also:
    • averageInt

      public static <T> double averageInt(Collection<? extends T> c, int fromIndex, int toIndex, ToIntFunction<? super T> func) throws IndexOutOfBoundsException
      Calculates the average of the elements within the specified range in the input collection using the provided function to convert each element to an integer.
      Type Parameters:
      T - The type of the elements in the collection
      Parameters:
      fromIndex - The starting index (inclusive) of the range.
      toIndex - The ending index (exclusive) of the range.
      func - The function to convert each element to an integer.
      a - The array to calculate the average.
      Returns:
      The average of the elements within the specified range as a double.
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds.
      See Also:
    • averageInt

      public static <T extends Number> double averageInt(Iterable<? extends T> c)
      Calculates the average of the elements in the given iterable of numbers.
      Type Parameters:
      T - The type of the elements in the iterable, which must extend Number.
      Parameters:
      c - The iterable of numbers to calculate the average.
      Returns:
      The average of the elements in the iterable as a double.
      See Also:
    • averageInt

      public static <T> double averageInt(Iterable<? extends T> c, ToIntFunction<? super T> func)
      Calculates the average of the elements in the given iterable using the provided function to convert each element to an integer.
      Type Parameters:
      T - The type of the elements in the iterable.
      Parameters:
      c - The iterable of elements to calculate the average.
      func - The function to convert each element to an integer.
      Returns:
      The average of the elements in the iterable as a double.
      See Also:
    • averageLong

      public static <T extends Number> double averageLong(T[] a)
      Calculates the average of the elements in the given array of numbers.
      Type Parameters:
      T - The type of the elements in the array, which must extend Number.
      Parameters:
      a - The array of numbers to calculate the average.
      Returns:
      The average of the elements in the array as a double.
      See Also:
    • averageLong

      public static <T extends Number> double averageLong(T[] a, int fromIndex, int toIndex)
      Calculates the average of the elements within the specified range in the input array of numbers.
      Type Parameters:
      T - The type of the elements in the array, which must extend Number.
      Parameters:
      a - The array of numbers to calculate the average.
      fromIndex - The starting index (inclusive) of the range.
      toIndex - The ending index (exclusive) of the range.
      Returns:
      The average of the elements within the specified range as a double.
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds.
      See Also:
    • averageLong

      public static <T> double averageLong(T[] a, ToLongFunction<? super T> func)
      Calculates the average of the elements in the given array using the provided function to convert each element to a long.
      Type Parameters:
      T - The type of the elements in the array
      Parameters:
      a - The array of numbers to calculate the average.
      func - The function to convert each element to a long.
      Returns:
      The average of the elements in the array as a double.
      See Also:
    • averageLong

      public static <T> double averageLong(T[] a, int fromIndex, int toIndex, ToLongFunction<? super T> func) throws IndexOutOfBoundsException
      Calculates the average of the elements within the specified range in the input array using the provided function to convert each element to a long.
      Type Parameters:
      T - The type of the elements in the array
      Parameters:
      a - The array of numbers to calculate the average.
      fromIndex - The starting index (inclusive) of the range.
      toIndex - The ending index (exclusive) of the range.
      func - The function to convert each element to a long.
      Returns:
      The average of the elements within the specified range as a double.
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds.
      See Also:
    • averageLong

      public static <T extends Number> double averageLong(Collection<? extends T> c, int fromIndex, int toIndex)
      Calculates the average of the elements in the given collection of numbers.
      Type Parameters:
      T - The type of the elements in the collection, which must extend Number.
      Parameters:
      c - The collection of numbers to calculate the average.
      Returns:
      The average of the elements in the collection as a double.
      See Also:
    • averageLong

      public static <T> double averageLong(Collection<? extends T> c, int fromIndex, int toIndex, ToLongFunction<? super T> func) throws IndexOutOfBoundsException
      Calculates the average of the elements within the specified range in the input collection using the provided function to convert each element to a long.
      Type Parameters:
      T - The type of the elements in the collection
      Parameters:
      fromIndex - The starting index (inclusive) of the range.
      toIndex - The ending index (exclusive) of the range.
      func - The function to convert each element to a long.
      a - The array to calculate the average.
      Returns:
      The average of the elements within the specified range as a double.
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds.
      See Also:
    • averageLong

      public static <T extends Number> double averageLong(Iterable<? extends T> c)
      Calculates the average of the elements in the given iterable of numbers.
      Type Parameters:
      T - The type of the elements in the iterable, which must extend Number.
      Parameters:
      c - The iterable of numbers to calculate the average.
      Returns:
      The average of the elements in the iterable as a double.
      See Also:
    • averageLong

      public static <T> double averageLong(Iterable<? extends T> c, ToLongFunction<? super T> func)
      Calculates the average of the elements in the given iterable using the provided function to convert each element to a long.
      Type Parameters:
      T - The type of the elements in the iterable.
      Parameters:
      c - The iterable of elements to calculate the average.
      func - The function to convert each element to a long.
      Returns:
      The average of the elements in the iterable as a double.
      See Also:
    • averageDouble

      public static <T extends Number> double averageDouble(T[] a)
      Calculates the average of the elements in the given array of numbers.
      Type Parameters:
      T - The type of the elements in the array, which must extend Number.
      Parameters:
      a - The array of numbers to calculate the average.
      Returns:
      The average of the elements in the array as a double.
      See Also:
    • averageDouble

      public static <T extends Number> double averageDouble(T[] a, int fromIndex, int toIndex)
      Calculates the average of the elements within the specified range in the input array of numbers.
      Type Parameters:
      T - The type of the elements in the array, which must extend Number.
      Parameters:
      a - The array of numbers to calculate the average.
      fromIndex - The starting index (inclusive) of the range.
      toIndex - The ending index (exclusive) of the range.
      Returns:
      The average of the elements within the specified range as a double.
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds.
      See Also:
    • averageDouble

      public static <T> double averageDouble(T[] a, ToDoubleFunction<? super T> func)
      Calculates the average of the elements in the given array using the provided function to convert each element to a double.
      Type Parameters:
      T - The type of the elements in the array
      Parameters:
      a - The array to calculate the average.
      func - The function to convert each element to a double.
      Returns:
      The average of the elements in the array as a double.
      See Also:
    • averageDouble

      public static <T> double averageDouble(T[] a, int fromIndex, int toIndex, ToDoubleFunction<? super T> func) throws IndexOutOfBoundsException
      Calculates the average of the elements within the specified range in the input array using the provided function to convert each element to a double.
      Type Parameters:
      T - The type of the elements in the array
      Parameters:
      a - The array to calculate the average.
      fromIndex - The starting index (inclusive) of the range.
      toIndex - The ending index (exclusive) of the range.
      func - The function to convert each element to a double.
      Returns:
      The average of the elements within the specified range as a double.
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds.
      See Also:
    • averageDouble

      public static <T extends Number> double averageDouble(Collection<? extends T> c, int fromIndex, int toIndex)
      Calculates the average of the elements in the given collection of numbers.
      Type Parameters:
      T - The type of the elements in the collection, which must extend Number.
      Parameters:
      c - The collection of numbers to calculate the average.
      Returns:
      The average of the elements in the collection as a double.
      See Also:
    • averageDouble

      public static <T> double averageDouble(Collection<? extends T> c, int fromIndex, int toIndex, ToDoubleFunction<? super T> func) throws IndexOutOfBoundsException
      Calculates the average of the elements within the specified range in the input collection using the provided function to convert each element to a double.
      Type Parameters:
      T - The type of the elements in the collection
      Parameters:
      c - The collection to calculate the average.
      fromIndex - The starting index (inclusive) of the range.
      toIndex - The ending index (exclusive) of the range.
      func - The function to convert each element to a double.
      Returns:
      The average of the elements within the specified range as a double.
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds.
      See Also:
    • averageDouble

      public static <T extends Number> double averageDouble(Iterable<? extends T> c)
      Calculates the average of the elements in the given iterable of numbers.
      Type Parameters:
      T - The type of the elements in the iterable, which must extend Number.
      Parameters:
      c - The iterable of numbers to calculate the average.
      Returns:
      The average of the elements in the iterable as a double.
      See Also:
    • averageDouble

      public static <T> double averageDouble(Iterable<? extends T> c, ToDoubleFunction<? super T> func)
      Calculates the average of the elements in the given iterable using the provided function to convert each element to a double.
      Type Parameters:
      T - The type of the elements in the iterable.
      Parameters:
      c - The iterable of elements to calculate the average.
      func - The function to convert each element to a double.
      Returns:
      The average of the elements in the iterable as a double.
      See Also:
    • averageBigInteger

      public static BigDecimal averageBigInteger(Iterable<? extends BigInteger> c)
      Calculates the average of the elements in the given iterable of BigInteger.
      Parameters:
      c - The iterable of BigInteger elements to calculate the average.
      Returns:
      The average of the elements in the iterable as a BigDecimal.
      See Also:
    • averageBigInteger

      public static <T> BigDecimal averageBigInteger(Iterable<? extends T> c, Function<? super T,BigInteger> func)
      Calculates the average of the elements in the given iterable using the provided function to convert each element to a BigInteger.
      Type Parameters:
      T - The type of elements in the iterable.
      Parameters:
      c - The iterable of elements to calculate the average.
      func - The function to convert each element to a BigInteger.
      Returns:
      The average of the elements in the iterable as a BigDecimal.
      See Also:
    • averageBigDecimal

      public static BigDecimal averageBigDecimal(Iterable<? extends BigDecimal> c)
      Calculates the average of the elements in the given iterable of BigDecimal.
      Parameters:
      c - The iterable of BigDecimal elements to calculate the average.
      Returns:
      The average of the elements in the iterable as a BigDecimal.
      See Also:
    • averageBigDecimal

      public static <T> BigDecimal averageBigDecimal(Iterable<? extends T> c, Function<? super T,BigDecimal> func)
      Calculates the average of the elements in the given iterable using the provided function to convert each element to a BigDecimal.
      Type Parameters:
      T - The type of elements in the iterable.
      Parameters:
      c - The iterable of elements to calculate the average.
      func - The function to convert each element to a BigDecimal.
      Returns:
      The average of the elements in the iterable as a BigDecimal.
      See Also:
    • min

      public static char min(char a, char b)
      Returns the smaller of two input char values.
      Parameters:
      a - the first char value.
      b - the second char value.
      Returns:
      the smaller of two input char values.
    • min

      public static byte min(byte a, byte b)
      Returns the smaller of two input byte values.
      Parameters:
      a - the first byte value.
      b - the second byte value.
      Returns:
      the smaller of two input byte values.
    • min

      public static short min(short a, short b)
      Returns the smaller of two input short values.
      Parameters:
      a - the first short value.
      b - the second short value.
      Returns:
      the smaller of two input short values.
    • min

      public static int min(int a, int b)
      Returns the smaller of two input int values.
      Parameters:
      a - the first int value.
      b - the second int value.
      Returns:
      the smaller of two input int values
    • min

      public static long min(long a, long b)
      Returns the smaller of two input long values.
      Parameters:
      a - the first long value.
      b - the second long value.
      Returns:
      the smaller of two input long values.
    • min

      public static float min(float a, float b)
      Returns the smaller of two input float values.
      Parameters:
      a - the first float value.
      b - the second float value.
      Returns:
      the smaller of two input float values.
    • min

      public static double min(double a, double b)
      Returns the smaller of two input double values.
      Parameters:
      a - the first double value.
      b - the second double value.
      Returns:
      the smaller of two input double values.
    • min

      public static <T extends Comparable<? super T>> T min(T a, T b)
      Returns the smaller of two input comparable values.
      Parameters:
      a - the first comparable value.
      b - the second comparable value.
      Returns:
      the smaller of two input comparable values.
    • min

      public static <T> T min(T a, T b, Comparator<? super T> cmp)
      Returns the smaller of two input values based on the specified comparator.
      Type Parameters:
      T - the type of the values
      Parameters:
      a - the first value to compare
      b - the second value to compare
      cmp - the Comparator to compare the values
      Returns:
      the smaller of two input values based on the specified comparator
    • min

      public static char min(char a, char b, char c)
      Returns the smallest of the three input char values.
      Parameters:
      a - the first char value.
      b - the second char value.
      c - the third char value.
      Returns:
      the smallest of the three input char values.
    • min

      public static byte min(byte a, byte b, byte c)
      Returns the smallest of the three input byte values.
      Parameters:
      a - the first byte value.
      b - the second byte value.
      c - the third byte value.
      Returns:
      the smallest of the three input byte values.
    • min

      public static short min(short a, short b, short c)
      Returns the smallest of the three input short values.
      Parameters:
      a - the first short value.
      b - the second short value.
      c - the third short value.
      Returns:
      the smallest of the three input short values.
    • min

      public static int min(int a, int b, int c)
      Returns the smallest of the three input int values.
      Parameters:
      a - the first int value.
      b - the second int value.
      c - the third int value.
      Returns:
      the smallest of the three input int values.
    • min

      public static long min(long a, long b, long c)
      Returns the smallest of the three input long values.
      Parameters:
      a - the first long value.
      b - the second long value.
      c - the third long value.
      Returns:
      the smallest of the three input long values.
    • min

      public static float min(float a, float b, float c)
      Returns the smallest of the three input float values.
      Parameters:
      a - the first float value.
      b - the second float value.
      c - the third float value.
      Returns:
      the smallest of the three input float values.
    • min

      public static double min(double a, double b, double c)
      Returns the smallest of the three input double values.
      Parameters:
      a - the first double value.
      b - the second double value.
      c - the third double value.
      Returns:
      the smallest of the three input double values.
    • min

      public static <T extends Comparable<? super T>> T min(T a, T b, T c)
      Returns the smallest of the three input comparable values.
      Parameters:
      a - the first comparable value.
      b - the second comparable value.
      c - the third comparable value.
      Returns:
      the smallest of the three input comparable values.
    • min

      public static <T> T min(T a, T b, T c, Comparator<? super T> cmp)
      Returns the smallest of the three input values based on the specified comparator.
      Type Parameters:
      T - the type of the values
      Parameters:
      a - the first value to compare
      b - the second value to compare
      c - the third value to compare
      cmp - the Comparator to compare the values
      Returns:
      the smallest of the three input values based on the specified comparator
    • min

      @SafeVarargs public static char min(char... a) throws IllegalArgumentException
      Returns the smallest char value in the specified array.
      Parameters:
      a - the array of char values to fetch the smallest value.
      Returns:
      the smallest char value in the array.
      Throws:
      IllegalArgumentException - if the array is null or empty.
    • min

      public static char min(char[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the smallest char value within the specified range in the input array.
      Parameters:
      a - the array of char values to fetch the smallest value.
      fromIndex - the starting index (inclusive) of the range.
      toIndex - the ending index (exclusive) of the range.
      Returns:
      the smallest char value within the specified range of the array.
      Throws:
      IllegalArgumentException - if the specified array or range is empty.
    • min

      @SafeVarargs public static byte min(byte... a) throws IllegalArgumentException
      Returns the smallest byte value in the specified array.
      Parameters:
      a - the array of byte values to fetch the smallest value.
      Returns:
      the smallest byte value in the array.
      Throws:
      IllegalArgumentException - if the array is null or empty.
    • min

      public static byte min(byte[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the smallest byte value within the specified range in the input array.
      Parameters:
      a - the array of byte values to fetch the smallest value.
      fromIndex - the starting index (inclusive) of the range.
      toIndex - the ending index (exclusive) of the range.
      Returns:
      the smallest byte value within the specified range of the array.
      Throws:
      IllegalArgumentException - if the specified array or range is empty.
    • min

      @SafeVarargs public static short min(short... a) throws IllegalArgumentException
      Returns the smallest short value in the specified array.
      Parameters:
      a - the array of short values to fetch the smallest value.
      Returns:
      the smallest short value in the array.
      Throws:
      IllegalArgumentException - if the array is null or empty.
    • min

      public static short min(short[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the smallest short value within the specified range in the input array.
      Parameters:
      a - the array of short values to fetch the smallest value.
      fromIndex - the starting index (inclusive) of the range.
      toIndex - the ending index (exclusive) of the range.
      Returns:
      the smallest short value within the specified range of the array.
      Throws:
      IllegalArgumentException - if the specified array or range is empty.
    • min

      @SafeVarargs public static int min(int... a) throws IllegalArgumentException
      Returns the smallest int value in the specified array.
      Parameters:
      a - the array of int values to fetch the smallest value.
      Returns:
      the smallest int value in the array.
      Throws:
      IllegalArgumentException - if the array is null or empty.
    • min

      public static int min(int[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the smallest int value within the specified range in the input array.
      Parameters:
      a - the array of int values to fetch the smallest value.
      fromIndex - the starting index (inclusive) of the range.
      toIndex - the ending index (exclusive) of the range.
      Returns:
      the smallest int value within the specified range of the array.
      Throws:
      IllegalArgumentException - if the specified array or range is empty.
    • min

      @SafeVarargs public static long min(long... a) throws IllegalArgumentException
      Returns the smallest long value in the specified array.
      Parameters:
      a - the array of long values to fetch the smallest value.
      Returns:
      the smallest long value in the array.
      Throws:
      IllegalArgumentException - if the array is null or empty.
    • min

      public static long min(long[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the smallest long value within the specified range in the input array.
      Parameters:
      a - the array of long values to fetch the smallest value.
      fromIndex - the starting index (inclusive) of the range.
      toIndex - the ending index (exclusive) of the range.
      Returns:
      the smallest long value within the specified range of the array.
      Throws:
      IllegalArgumentException - if the specified array or range is empty.
    • min

      @SafeVarargs public static float min(float... a) throws IllegalArgumentException
      Returns the smallest float value in the specified array.
      Parameters:
      a - the array of float values to fetch the smallest value.
      Returns:
      the smallest float value in the array.
      Throws:
      IllegalArgumentException - if the array is null or empty.
      See Also:
    • min

      public static float min(float[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the smallest float value within the specified range in the input array.
      Parameters:
      a - the array of float values to fetch the smallest value.
      fromIndex - the starting index (inclusive) of the range.
      toIndex - the ending index (exclusive) of the range.
      Returns:
      the smallest float value within the specified range of the array.
      Throws:
      IllegalArgumentException - if the specified array or range is empty.
      See Also:
    • min

      @SafeVarargs public static double min(double... a) throws IllegalArgumentException
      Returns the smallest double value in the specified array.
      Parameters:
      a - the array of double values to fetch the smallest value.
      Returns:
      the smallest double value in the array.
      Throws:
      IllegalArgumentException - if the array is null or empty.
      See Also:
    • min

      public static double min(double[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the smallest double value within the specified range in the input array.
      Parameters:
      a - the array of double values to fetch the smallest value.
      fromIndex - the starting index (inclusive) of the range.
      toIndex - the ending index (exclusive) of the range.
      Returns:
      the smallest double value within the specified range of the array.
      Throws:
      IllegalArgumentException - if the specified array or range is empty.
      See Also:
    • min

      public static <T extends Comparable<? super T>> T min(T[] a) throws IllegalArgumentException
      Returns the smallest value in the specified array based on their natural ordering. Null values are considered to be maximum here.
      Parameters:
      a - the array to fetch the smallest value.
      Returns:
      the smallest value in the array.
      Throws:
      IllegalArgumentException - if the array is null or empty.
      See Also:
    • min

      public static <T extends Comparable<? super T>> T min(T[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the smallest value within the specified range in the input array based on their natural ordering. Null values are considered to be maximum here.
      Parameters:
      a - the array to fetch the smallest value.
      fromIndex - the starting index (inclusive) of the range.
      toIndex - the ending index (exclusive) of the range.
      Returns:
      the smallest value within the specified range of the array.
      Throws:
      IllegalArgumentException - if the specified array or range is empty.
      See Also:
      • invalid reference
        Iterables#min(Comparable[], int, int)
    • min

      public static <T> T min(T[] a, Comparator<? super T> cmp) throws IllegalArgumentException
      Returns the smallest value in the specified array according to the provided comparator.
      Type Parameters:
      T - the type of elements in the input array.
      Parameters:
      a - the array to fetch the smallest value.
      cmp - the comparator to be used to compare the elements
      Returns:
      the smallest value in the array.
      Throws:
      IllegalArgumentException - if the array is null or empty.
      See Also:
    • min

      public static <T> T min(T[] a, int fromIndex, int toIndex, Comparator<? super T> cmp) throws IndexOutOfBoundsException, IllegalArgumentException
      Returns the smallest value within the specified range in the input array according to the provided comparator.
      Type Parameters:
      T - the type of elements in the input array.
      Parameters:
      a - the array to fetch the smallest value.
      fromIndex - the starting index (inclusive) of the range.
      toIndex - the ending index (exclusive) of the range.
      cmp - the comparator to be used to compare the elements
      Returns:
      the smallest value within the specified range of the array.
      Throws:
      IllegalArgumentException - if the specified array or range is empty.
      IndexOutOfBoundsException
      See Also:
    • min

      public static <T extends Comparable<? super T>> T min(Collection<? extends T> c, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the smallest value within the specified range in the input collection based on their natural ordering. Null values are considered to be maximum here.
      Parameters:
      c - the collection to fetch the smallest value.
      fromIndex - the starting index (inclusive) of the range.
      toIndex - the ending index (exclusive) of the range.
      Returns:
      the smallest value within the specified range of the collection.
      Throws:
      IllegalArgumentException - if the specified collection or range is empty.
      See Also:
      • invalid reference
        Iterables#min(Collection)
    • min

      public static <T> T min(Collection<? extends T> c, int fromIndex, int toIndex, Comparator<? super T> cmp) throws IllegalArgumentException
      Returns the smallest value within the specified range in the input collection according to the provided comparator.
      Parameters:
      c - the collection to fetch the smallest value.
      fromIndex - the starting index (inclusive) of the range.
      toIndex - the ending index (exclusive) of the range.
      cmp - the comparator to be used to compare the elements
      Returns:
      the smallest value within the specified range of the collection.
      Throws:
      IllegalArgumentException - if the specified collection or range is empty.
      See Also:
      • invalid reference
        Iterables#min(Collection, Comparator)
    • min

      public static <T extends Comparable<? super T>> T min(Iterable<? extends T> c) throws IllegalArgumentException
      Returns the smallest value in the specified iterable based on their natural ordering. Null values are considered to be maximum here.
      Type Parameters:
      T - the type of elements in the input iterable.
      Parameters:
      c - the iterable to fetch the smallest value.
      Returns:
      the smallest value in the iterable.
      Throws:
      IllegalArgumentException - if the specified iterable is null or empty.
      See Also:
    • min

      public static <T> T min(Iterable<? extends T> c, Comparator<? super T> cmp) throws IllegalArgumentException
      Returns the smallest value in the specified iterable according to the provided comparator.
      Type Parameters:
      T - the type of elements in the input iterable.
      Parameters:
      c - the iterable to fetch the smallest value.
      cmp - the comparator to be used to compare the elements
      Returns:
      the smallest value in the iterable.
      Throws:
      IllegalArgumentException - if the specified iterable is null or empty.
      See Also:
    • min

      public static <T extends Comparable<? super T>> T min(Iterator<? extends T> iter) throws IllegalArgumentException
      Returns the smallest value in the specified iterator based on their natural ordering. Null values are considered to be maximum here.
      Type Parameters:
      T - the type of elements in the input iterator.
      Parameters:
      iter - the iterator to fetch the smallest value.
      Returns:
      the smallest value in the iterator.
      Throws:
      IllegalArgumentException - if the iterator is null or empty.
      See Also:
    • min

      public static <T> T min(Iterator<? extends T> iter, Comparator<? super T> cmp) throws IllegalArgumentException
      Returns the smallest value in the specified iterator according to the provided comparator.
      Type Parameters:
      T - the type of elements in the input iterator.
      Parameters:
      iter - the iterator to fetch the smallest value.
      cmp - the comparator to be used to compare the elements
      Returns:
      the smallest value in the iterator.
      Throws:
      IllegalArgumentException - if the specified iterator is null or empty.
      See Also:
    • minAll

      public static <T extends Comparable<? super T>> List<T> minAll(T[] a)
      Returns a list containing the smallest elements in the specified array based on their natural ordering. Null values are considered to be maximum here.
      Type Parameters:
      T - the type of elements in the input array.
      Parameters:
      a - the array to fetch the smallest elements.
      Returns:
      a list containing the smallest elements in the array. If the array is null or empty, an empty list is returned.
    • minAll

      public static <T> List<T> minAll(T[] a, Comparator<? super T> cmp)
      Returns a list containing the smallest elements in the specified array according to the provided comparator.
      Type Parameters:
      T - the type of elements in the array.
      Parameters:
      a - the array to fetch the smallest elements.
      cmp - the comparator to be used to compare the elements
      Returns:
      a list containing the smallest elements in the array. If the array is null or empty, an empty list is returned.
    • minAll

      public static <T extends Comparable<? super T>> List<T> minAll(Iterable<? extends T> c)
      Returns a list containing the smallest elements in the specified iterable based on their natural ordering. Null values are considered to be maximum here.
      Type Parameters:
      T - the type of elements in the input iterable.
      Parameters:
      c - the iterable to fetch the smallest elements.
      Returns:
      a list containing the smallest elements in the iterable. If the iterable is null or empty, an empty list is returned.
    • minAll

      public static <T> List<T> minAll(Iterable<? extends T> c, Comparator<? super T> cmp)
      Returns a list containing the smallest elements in the specified iterable according to the provided comparator.
      Type Parameters:
      T - the type of elements in the input iterable.
      Parameters:
      c - the iterable to fetch the smallest elements.
      cmp - the comparator to be used to compare the elements
      Returns:
      a list containing the smallest elements in the iterable. If the iterable is null or empty, an empty list is returned.
    • minAll

      public static <T extends Comparable<? super T>> List<T> minAll(Iterator<? extends T> iter)
      Returns a list containing the smallest elements in the specified iterator based on their natural ordering. Null values are considered to be maximum here.
      Type Parameters:
      T - the type of elements in the input iterator.
      Parameters:
      iter - the iterator to fetch the smallest elements.
      Returns:
      a list containing the smallest elements in the iterator. If the iterator is null or empty, an empty list is returned.
    • minAll

      public static <T> List<T> minAll(Iterator<? extends T> iter, Comparator<? super T> cmp)
      Returns a list containing the smallest elements in the specified iterator according to the provided comparator.
      Type Parameters:
      T - the type of elements in the input iterator.
      Parameters:
      iter - the iterator to fetch the smallest elements.
      cmp - the comparator to be used to compare the elements
      Returns:
      a list containing the smallest elements in the iterator. If the iterator is null or empty, an empty list is returned.
    • minOrDefaultIfEmpty

      @Beta public static <T, R extends Comparable<? super R>> R minOrDefaultIfEmpty(T[] a, Function<? super T,? extends R> valueExtractor, R defaultValue)
      Returns the minimum value extracted from the specified array or a default value if the array is null or empty. Null values are considered to be maximum here.
      Type Parameters:
      T - the type of elements in the input array.
      R - the type of the extracted value, which must be comparable.
      Parameters:
      a - the array to extract the minimum value from.
      valueExtractor - the function to extract values from the array elements for comparison.
      defaultValue - the default value to return if the array is null or empty.
      Returns:
      the minimum extracted value or the default value if the array is null or empty.
    • minOrDefaultIfEmpty

      public static <T, R extends Comparable<? super R>> R minOrDefaultIfEmpty(Iterable<? extends T> c, Function<? super T,? extends R> valueExtractor, R defaultValue)
      Returns the minimum value extracted from the specified iterable or a default value if the iterable is null or empty. Null values are considered to be maximum here.
      Type Parameters:
      T - the type of elements in the input iterable.
      R - the type of the extracted value, which must be comparable.
      Parameters:
      c - the iterable to extract the minimum value from.
      valueExtractor - the function to extract values from the iterable elements for comparison.
      defaultValue - the default value to return if the iterable is null or empty.
      Returns:
      the minimum extracted value or the default value if the iterable is null or empty.
    • minOrDefaultIfEmpty

      public static <T, R extends Comparable<? super R>> R minOrDefaultIfEmpty(Iterator<? extends T> iter, Function<? super T,? extends R> valueExtractor, R defaultValue)
      Returns the minimum value extracted from the specified iterator or a default value if the iterator is null or empty. Null values are considered to be maximum here.
      Type Parameters:
      T - the type of elements in the input iterator.
      R - the type of the extracted value, which must be comparable.
      Parameters:
      iter - the iterator to extract the minimum value from.
      valueExtractor - the function to extract values from the iterator elements for comparison.
      defaultValue - the default value to return if the iterator is null or empty.
      Returns:
      the minimum extracted value or the default value if the iterator is null or empty.
    • minIntOrDefaultIfEmpty

      @Beta public static <T> int minIntOrDefaultIfEmpty(T[] a, ToIntFunction<? super T> valueExtractor, int defaultValue)
      Returns the minimum integer value extracted from the array or a default value if the array is null or empty.
      Type Parameters:
      T - the type of elements in the input array.
      Parameters:
      a - the array to extract the minimum integer from.
      valueExtractor - the function to extract integer values from the array elements.
      defaultValue - the default value to return if the array is null or empty.
      Returns:
      the minimum extracted integer value or the default value if the array is null or empty.
    • minIntOrDefaultIfEmpty

      @Beta public static <T> int minIntOrDefaultIfEmpty(Iterable<? extends T> c, ToIntFunction<? super T> valueExtractor, int defaultValue)
      Returns the minimum integer value extracted from the specified iterable or a default value if the iterable is null or empty.
      Type Parameters:
      T - the type of elements in the input iterable.
      Parameters:
      c - the iterable to extract the minimum integer from.
      valueExtractor - the function to extract integer values from the iterable elements.
      defaultValue - the default value to return if the iterable is null or empty.
      Returns:
      the minimum extracted integer value or the default value if the iterable is null or empty.
    • minIntOrDefaultIfEmpty

      @Beta public static <T> int minIntOrDefaultIfEmpty(Iterator<? extends T> iter, ToIntFunction<? super T> valueExtractor, int defaultValue)
      Returns the minimum integer value extracted from the specified iterator or a default value if the iterator is null or empty.
      Type Parameters:
      T - the type of elements in the input iterator.
      Parameters:
      iter - the iterator to extract the minimum integer from.
      valueExtractor - the function to extract integer values from the iterator elements.
      defaultValue - the default value to return if the iterator is null or empty.
      Returns:
      the minimum extracted integer value or the default value if the iterator is null or empty.
    • minLongOrDefaultIfEmpty

      @Beta public static <T> long minLongOrDefaultIfEmpty(T[] a, ToLongFunction<? super T> valueExtractor, long defaultValue)
      Returns the minimum long value extracted from the specified array or a default value if the array is null or empty.
      Type Parameters:
      T - the type of elements in the input array.
      Parameters:
      a - the array to extract the minimum long from.
      valueExtractor - the function to extract long values from the array elements.
      defaultValue - the default value to return if the array is null or empty.
      Returns:
      the minimum extracted long value or the default value if the array is null or empty.
    • minLongOrDefaultIfEmpty

      @Beta public static <T> long minLongOrDefaultIfEmpty(Iterable<? extends T> c, ToLongFunction<? super T> valueExtractor, long defaultValue)
      Returns the minimum long value extracted from the specified iterable or a default value if the iterable is null or empty.
      Type Parameters:
      T - the type of elements in the input iterable.
      Parameters:
      c - the iterable to extract the minimum long from.
      valueExtractor - the function to extract long values from the iterable elements.
      defaultValue - the default value to return if the iterable is null or empty.
      Returns:
      the minimum extracted long value or the default value if the iterable is null or empty.
    • minLongOrDefaultIfEmpty

      @Beta public static <T> long minLongOrDefaultIfEmpty(Iterator<? extends T> iter, ToLongFunction<? super T> valueExtractor, long defaultValue)
      Returns the minimum long value extracted from the specified iterator or a default value if the iterator is null or empty.
      Type Parameters:
      T - the type of elements in the input iterator.
      Parameters:
      iter - the iterator to extract the minimum long from.
      valueExtractor - the function to extract long values from the iterator elements.
      defaultValue - the default value to return if the iterator is null or empty.
      Returns:
      the minimum extracted long value or the default value if the iterator is null or empty.
    • minDoubleOrDefaultIfEmpty

      @Beta public static <T> double minDoubleOrDefaultIfEmpty(T[] a, ToDoubleFunction<? super T> valueExtractor, double defaultValue)
      Returns the minimum double value extracted from the specified array or a default value if the array is null or empty.
      Type Parameters:
      T - the type of elements in the input array.
      Parameters:
      a - the array to extract the minimum double from.
      valueExtractor - the function to extract double values from the array elements.
      defaultValue - the default value to return if the array is null or empty.
      Returns:
      the minimum extracted double value or the default value if the array is null or empty.
    • minDoubleOrDefaultIfEmpty

      @Beta public static <T> double minDoubleOrDefaultIfEmpty(Iterable<? extends T> c, ToDoubleFunction<? super T> valueExtractor, double defaultValue)
      Returns the minimum double value extracted from the specified iterable or a default value if the iterable is null or empty.
      Type Parameters:
      T - the type of elements in the input iterable.
      Parameters:
      c - the iterable to extract the minimum double from.
      valueExtractor - the function to extract double values from the iterable elements.
      defaultValue - the default value to return if the iterable is null or empty.
      Returns:
      the minimum extracted double value or the default value if the iterable is null or empty.
    • minDoubleOrDefaultIfEmpty

      @Beta public static <T> double minDoubleOrDefaultIfEmpty(Iterator<? extends T> iter, ToDoubleFunction<? super T> valueExtractor, double defaultValue)
      Returns the minimum double value extracted from the specified iterator or a default value if the iterator is null or empty.
      Type Parameters:
      T - the type of elements in the input iterator.
      Parameters:
      iter - the iterator to extract the minimum double from.
      valueExtractor - the function to extract double values from the iterator elements.
      defaultValue - the default value to return if the iterator is null or empty.
      Returns:
      the minimum extracted double value or the default value if the iterator is null or empty.
    • minMax

      public static <T extends Comparable<? super T>> Pair<T,T> minMax(T[] a) throws IllegalArgumentException
      Returns a Pair object containing the minimum and maximum values in the specified array based on their natural ordering. Null values are considered to be minimum here.
      Type Parameters:
      T - the type of elements in the input array, which must be comparable.
      Parameters:
      a - the array to find the minimum and maximum values from.
      Returns:
      a Pair object where the first element is the minimum value and the second element is the maximum value in the specified array.
      Throws:
      IllegalArgumentException - if the array is null or empty.
      See Also:
    • minMax

      public static <T> Pair<T,T> minMax(T[] a, Comparator<? super T> cmp) throws IllegalArgumentException
      Returns a Pair object containing the minimum and maximum values in the specified array according to the provided comparator.
      Type Parameters:
      T - the type of elements in the input array.
      Parameters:
      a - the array to find the minimum and maximum values from.
      cmp - the comparator to be used to compare the elements
      Returns:
      a Pair object where the first element is the minimum value and the second element is the maximum value in the specified array.
      Throws:
      IllegalArgumentException - if the array is null or empty.
      See Also:
    • minMax

      public static <T extends Comparable<? super T>> Pair<T,T> minMax(Iterable<? extends T> c) throws IllegalArgumentException
      Returns a Pair object containing the minimum and maximum values in the specified iterable based on their natural ordering. Null values are considered to be minimum here.
      Type Parameters:
      T - the type of elements in the input iterable, which must be comparable.
      Parameters:
      c - the iterable to find the minimum and maximum values from.
      Returns:
      a Pair object where the first element is the minimum value and the second element is the maximum value in the specified iterable.
      Throws:
      IllegalArgumentException - if the iterable is null or empty.
      See Also:
    • minMax

      public static <T> Pair<T,T> minMax(@NotNull Iterable<? extends T> c, Comparator<? super T> cmp) throws IllegalArgumentException
      Returns a Pair object containing the minimum and maximum values in the specified iterable according to the provided comparator.
      Type Parameters:
      T - the type of elements in the input iterable.
      Parameters:
      c - the iterable to find the minimum and maximum values from.
      cmp - the comparator to be used to compare the elements
      Returns:
      a Pair object where the first element is the minimum value and the second element is the maximum value in the specified iterable.
      Throws:
      IllegalArgumentException - if the iterable is null or empty.
      See Also:
    • minMax

      public static <T extends Comparable<? super T>> Pair<T,T> minMax(Iterator<? extends T> iter) throws IllegalArgumentException
      Returns a Pair object containing the minimum and maximum values in the specified iterator based on their natural ordering. Null values are considered to be minimum here.
      Type Parameters:
      T - the type of elements in the input iterator, which must be comparable.
      Parameters:
      iter - the iterator to find the minimum and maximum values from.
      Returns:
      a Pair object where the first element is the minimum value and the second element is the maximum value in the specified iterator.
      Throws:
      IllegalArgumentException - if the iterator is null or empty.
      See Also:
    • minMax

      public static <T> Pair<T,T> minMax(Iterator<? extends T> iter, Comparator<? super T> cmp) throws IllegalArgumentException
      Returns a Pair object containing the minimum and maximum values in the specified iterator according to the provided comparator.
      Type Parameters:
      T - the type of elements in the input iterator.
      Parameters:
      iter - the iterator to find the minimum and maximum values from.
      cmp - the comparator to be used to compare the elements
      Returns:
      a Pair object where the first element is the minimum value and the second element is the maximum value in the specified iterator.
      Throws:
      IllegalArgumentException - if the iterator is null or empty.
      See Also:
    • max

      public static char max(char a, char b)
      Returns the bigger of two char values.
      Parameters:
      a - the first char value.
      b - the second char value.
      Returns:
      the bigger of the two char values.
    • max

      public static byte max(byte a, byte b)
      Returns the bigger of two byte values.
      Parameters:
      a - the first byte value.
      b - the second byte value.
      Returns:
      the bigger of the two byte values.
    • max

      public static short max(short a, short b)
      Returns the bigger of two short values.
      Parameters:
      a - the first short value.
      b - the second short value.
      Returns:
      the bigger of the two short values.
    • max

      public static int max(int a, int b)
      Returns the bigger of two int values.
      Parameters:
      a - the first int value.
      b - the second int value.
      Returns:
      the bigger of the two int values.
    • max

      public static long max(long a, long b)
      Returns the bigger of two long values.
      Parameters:
      a - the first long value.
      b - the second long value.
      Returns:
      the bigger of the two long values.
    • max

      public static float max(float a, float b)
      Returns the bigger of two float values.
      Parameters:
      a - the first float value.
      b - the second float value.
      Returns:
      the bigger of the two float values.
    • max

      public static double max(double a, double b)
      Returns the bigger of two double values.
      Parameters:
      a - the first double value.
      b - the second double value.
      Returns:
      the bigger of the two double values.
    • max

      public static <T extends Comparable<? super T>> T max(T a, T b)
      Returns the bigger value of the two provided values based on their natural ordering. Null values are considered to be minimum here.
      Type Parameters:
      T - the type of the objects being compared, which must be comparable.
      Parameters:
      a - the first object to compare.
      b - the second object to compare.
      Returns:
      the bigger value of the two provided values.
    • max

      public static <T> T max(T a, T b, Comparator<? super T> cmp)
      Returns the bigger value of the two provided values according to the provided comparator.
      Type Parameters:
      T - the type of the objects being compared.
      Parameters:
      a - the first object to compare.
      b - the second object to compare.
      cmp - the comparator to be used to compare the objects
      Returns:
      the bigger value of the two provided values.
    • max

      public static char max(char a, char b, char c)
      Returns the biggest value among the provided values.
      Parameters:
      a - the first char value.
      b - the second char value.
      c - the third char value.
      Returns:
      the biggest value among the provided values.
    • max

      public static byte max(byte a, byte b, byte c)
      Returns the biggest value among the provided values.
      Parameters:
      a - the first byte value.
      b - the second byte value.
      c - the third byte value.
      Returns:
      the biggest value among the provided values.
    • max

      public static short max(short a, short b, short c)
      Returns the biggest value among the provided values.
      Parameters:
      a - the first short value.
      b - the second short value.
      c - the third short value.
      Returns:
      the biggest value among the provided values.
    • max

      public static int max(int a, int b, int c)
      Returns the biggest value among the provided values.
      Parameters:
      a - the first int value.
      b - the second int value.
      c - the third int value.
      Returns:
      the biggest value among the provided values.
    • max

      public static long max(long a, long b, long c)
      Returns the biggest value among the provided values.
      Parameters:
      a - the first long value.
      b - the second long value.
      c - the third long value.
      Returns:
      the biggest value among the provided values.
    • max

      public static float max(float a, float b, float c)
      Returns the biggest value among the provided values.
      Parameters:
      a - the first float value.
      b - the second float value.
      c - the third float value.
      Returns:
      the biggest value among the provided values.
    • max

      public static double max(double a, double b, double c)
      Returns the biggest value among the provided values.
      Parameters:
      a - the first double value.
      b - the second double value.
      c - the third double value.
      Returns:
      the biggest value among the provided values.
    • max

      public static <T extends Comparable<? super T>> T max(T a, T b, T c)
      Returns the biggest value among the provided values based on their natural ordering. Null values are considered to be minimum here.
      Type Parameters:
      T - the type of the objects being compared, which must be comparable.
      Parameters:
      a - the first object to compare.
      b - the second object to compare.
      c - the third object to compare.
      Returns:
      the biggest value among the provided values.
    • max

      public static <T> T max(T a, T b, T c, Comparator<? super T> cmp)
      Returns the biggest value among the provided values according to the provided comparator.
      Type Parameters:
      T - the type of the objects being compared.
      Parameters:
      a - the first object to compare.
      b - the second object to compare.
      c - the third object to compare.
      cmp - the comparator to be used to compare the objects
      Returns:
      the biggest value among the provided values.
    • max

      @SafeVarargs public static char max(char... a) throws IllegalArgumentException
      Returns the biggest char value in the specified array of char values.
      Parameters:
      a - the array of char values to be compared.
      Returns:
      the biggest char value in the array.
      Throws:
      IllegalArgumentException - if the specified array is null or empty.
    • max

      public static char max(char[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the biggest char value within the given range in the specified array of char values.
      Parameters:
      a - the array of char values to be compared.
      fromIndex - the index of the first element (inclusive) to be considered in the range.
      toIndex - the index of the last element (exclusive) to be considered in the range.
      Returns:
      the biggest char value within the specified range of the array.
      Throws:
      IllegalArgumentException - if the specified array or range is empty.
    • max

      @SafeVarargs public static byte max(byte... a) throws IllegalArgumentException
      Returns the biggest byte value in the specified array of byte values.
      Parameters:
      a - the array of byte values to be compared.
      Returns:
      the biggest byte value in the array.
      Throws:
      IllegalArgumentException - if the specified array is null or empty.
    • max

      public static byte max(byte[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the biggest byte value within the given range in the specified array of byte values.
      Parameters:
      a - the array of byte values to be compared.
      fromIndex - the index of the first element (inclusive) to be considered in the range.
      toIndex - the index of the last element (exclusive) to be considered in the range.
      Returns:
      the biggest byte value within the specified range of the array.
      Throws:
      IllegalArgumentException - if the specified array or range is empty.
    • max

      @SafeVarargs public static short max(short... a) throws IllegalArgumentException
      Returns the biggest short value in the specified array of short values.
      Parameters:
      a - the array of short values to be compared.
      Returns:
      the biggest short value in the array.
      Throws:
      IllegalArgumentException - if the specified array is null or empty.
    • max

      public static short max(short[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the biggest short value within the given range in the specified array of short values.
      Parameters:
      a - the array of short values to be compared.
      fromIndex - the index of the first element (inclusive) to be considered in the range.
      toIndex - the index of the last element (exclusive) to be considered in the range.
      Returns:
      the biggest short value within the specified range of the array.
      Throws:
      IllegalArgumentException - if the specified array or range is empty.
    • max

      @SafeVarargs public static int max(int... a) throws IllegalArgumentException
      Returns the biggest int value in the specified array of int values.
      Parameters:
      a - the array of int values to be compared.
      Returns:
      the biggest int value in the array.
      Throws:
      IllegalArgumentException - if the specified array is null or empty.
    • max

      public static int max(int[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the biggest int value within the given range in the specified array of int values.
      Parameters:
      a - the array of int values to be compared.
      fromIndex - the index of the first element (inclusive) to be considered in the range.
      toIndex - the index of the last element (exclusive) to be considered in the range.
      Returns:
      the biggest int value within the specified range of the array.
      Throws:
      IllegalArgumentException - if the specified array or range is empty.
    • max

      @SafeVarargs public static long max(long... a) throws IllegalArgumentException
      Returns the biggest long value in the specified array of long values.
      Parameters:
      a - the array of long values to be compared.
      Returns:
      the biggest long value in the array.
      Throws:
      IllegalArgumentException - if the specified array is null or empty.
    • max

      public static long max(long[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the biggest long value within the given range in the specified array of long values.
      Parameters:
      a - the array of long values to be compared.
      fromIndex - the index of the first element (inclusive) to be considered in the range.
      toIndex - the index of the last element (exclusive) to be considered in the range.
      Returns:
      the biggest long value within the specified range of the array.
      Throws:
      IllegalArgumentException - if the specified array or range is empty.
    • max

      @SafeVarargs public static float max(float... a) throws IllegalArgumentException
      Returns the biggest float value in the specified array of float values.
      Parameters:
      a - the array of float values to be compared.
      Returns:
      the biggest float value in the array.
      Throws:
      IllegalArgumentException - if the specified array is null or empty.
      See Also:
    • max

      public static float max(float[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the biggest float value within the given range in the specified array of float values.
      Parameters:
      a - the array of float values to be compared.
      fromIndex - the index of the first element (inclusive) to be considered in the range.
      toIndex - the index of the last element (exclusive) to be considered in the range.
      Returns:
      the biggest float value within the specified range of the array.
      Throws:
      IllegalArgumentException - if the specified array or range is empty.
      See Also:
    • max

      @SafeVarargs public static double max(double... a) throws IllegalArgumentException
      Returns the biggest double value in the specified array of double values.
      Parameters:
      a - the array of double values to be compared.
      Returns:
      the biggest double value in the array.
      Throws:
      IllegalArgumentException - if the specified array is null or empty.
      See Also:
    • max

      public static double max(double[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the biggest double value within the given range in the specified array of double values.
      Parameters:
      a - the array of double values to be compared.
      fromIndex - the index of the first element (inclusive) to be considered in the range.
      toIndex - the index of the last element (exclusive) to be considered in the range.
      Returns:
      the biggest double value within the specified range of the array.
      Throws:
      IllegalArgumentException - if the specified array or range is empty.
      See Also:
    • max

      public static <T extends Comparable<? super T>> T max(T[] a) throws IllegalArgumentException
      Returns the biggest element in the specified array based on their natural ordering. Null values are considered to be minimum here.
      Type Parameters:
      T - the type of the objects being compared, which must be comparable.
      Parameters:
      a - the array of comparable objects to be compared.
      Returns:
      the biggest element in the array.
      Throws:
      IllegalArgumentException - if the specified array is null or empty.
      See Also:
    • max

      public static <T extends Comparable<? super T>> T max(T[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the biggest element within the given range in the specified array based on their natural ordering. Null values are considered to be minimum here.
      Type Parameters:
      T - the type of the objects being compared, which must be comparable.
      Parameters:
      a - the array of comparable objects to be compared.
      fromIndex - the index of the first element (inclusive) to be considered in the range.
      toIndex - the index of the last element (exclusive) to be considered in the range.
      Returns:
      the biggest element within the specified range of the array.
      Throws:
      IllegalArgumentException - if the specified array or range is empty.
      See Also:
    • max

      public static <T> T max(T[] a, Comparator<? super T> cmp) throws IllegalArgumentException
      Returns the biggest element in the specified array according to the provided comparator.
      Type Parameters:
      T - the type of the objects being compared.
      Parameters:
      a - the array of objects to be compared.
      cmp - the comparator to be used to compare the objects
      Returns:
      the biggest element in the array.
      Throws:
      IllegalArgumentException - if the specified array is null or empty.
      See Also:
    • max

      public static <T> T max(T[] a, int fromIndex, int toIndex, Comparator<? super T> cmp) throws IndexOutOfBoundsException, IllegalArgumentException
      Returns the biggest element within the given range in the specified array according to the provided comparator.
      Type Parameters:
      T - the type of the objects being compared.
      Parameters:
      a - the array of objects to be compared.
      fromIndex - the index of the first element (inclusive) to be considered in the range.
      toIndex - the index of the last element (exclusive) to be considered in the range.
      cmp - the comparator to be used to compare the objects
      Returns:
      the biggest element within the specified range of the array.
      Throws:
      IllegalArgumentException - if the specified array or range is empty.
      IndexOutOfBoundsException
      See Also:
    • max

      public static <T extends Comparable<? super T>> T max(Collection<? extends T> c, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the biggest element within the given range in the specified collection according to the provided comparator.
      Type Parameters:
      T - the type of the objects being compared.
      Parameters:
      c - the collection of objects to be compared.
      fromIndex - the index of the first element (inclusive) to be considered in the range.
      toIndex - the index of the last element (exclusive) to be considered in the range.
      cmp - the comparator to be used to compare the objects
      Returns:
      the biggest element within the specified range of the collection.
      Throws:
      IllegalArgumentException - if the specified collection or range is empty.
      See Also:
      • invalid reference
        Iterables#max(Collection)
    • max

      public static <T> T max(Collection<? extends T> c, int fromIndex, int toIndex, Comparator<? super T> cmp) throws IllegalArgumentException
      Returns the biggest element within the given range in the specified collection according to the provided comparator.
      Type Parameters:
      T - the type of the objects being compared.
      Parameters:
      c - the collection of objects to be compared.
      fromIndex - the index of the first element (inclusive) to be considered in the range.
      toIndex - the index of the last element (exclusive) to be considered in the range.
      cmp - the comparator to be used to compare the objects
      Returns:
      the biggest element within the specified range of the collection.
      Throws:
      IllegalArgumentException - if the specified collection or range is empty.
      See Also:
      • invalid reference
        Iterables#max(Collection, Comparator)
    • max

      public static <T extends Comparable<? super T>> T max(Iterable<? extends T> c) throws IllegalArgumentException
      Returns the biggest element in the specified iterable based on their natural ordering. Null values are considered to be minimum here.
      Type Parameters:
      T - the type of the objects being compared, which must be comparable.
      Parameters:
      c - the iterable of comparable objects to be compared.
      Returns:
      the biggest element in the iterable.
      Throws:
      IllegalArgumentException - if the specified iterable is null or empty.
      See Also:
    • max

      public static <T> T max(Iterable<? extends T> c, Comparator<? super T> cmp) throws IllegalArgumentException
      Returns the biggest element in the specified iterable according to the provided comparator.
      Type Parameters:
      T - the type of the objects being compared.
      Parameters:
      c - the iterable of objects to be compared.
      cmp - the comparator to be used to compare the objects
      Returns:
      the biggest element in the iterable.
      Throws:
      IllegalArgumentException - if the specified iterable is null or empty.
      See Also:
    • max

      public static <T extends Comparable<? super T>> T max(Iterator<? extends T> iter) throws IllegalArgumentException
      Returns the biggest element in the specified iterator based on their natural ordering. Null values are considered to be minimum here.
      Type Parameters:
      T - the type of the objects being compared, which must be comparable.
      Parameters:
      iter - the iterator of comparable objects to be compared.
      Returns:
      the biggest element in the iterator.
      Throws:
      IllegalArgumentException - if the specified iterator is null or empty.
      See Also:
    • max

      public static <T> T max(Iterator<? extends T> iter, Comparator<? super T> cmp) throws IllegalArgumentException
      Returns the biggest element in the specified iterator according to the provided comparator.
      Type Parameters:
      T - the type of the objects being compared.
      Parameters:
      iter - the iterator of objects to be compared.
      cmp - the comparator to be used to compare the objects
      Returns:
      the biggest element in the iterator.
      Throws:
      IllegalArgumentException - if the specified iterator is null or empty.
      See Also:
    • maxAll

      public static <T extends Comparable<? super T>> List<T> maxAll(T[] a)
      Returns a list containing the biggest elements in the specified array based on their natural ordering. Null values are considered to be minimum here.
      Type Parameters:
      T - the type of elements in the input array, which must be comparable.
      Parameters:
      a - the array to fetch the biggest elements.
      Returns:
      a list containing the biggest elements in the array. If the array is null or empty, an empty list is returned.
    • maxAll

      public static <T> List<T> maxAll(T[] a, Comparator<? super T> cmp)
      Returns a list containing all biggest elements in the specified array according to the provided comparator.
      Type Parameters:
      T - the type of elements in the input array.
      Parameters:
      a - the array to fetch the biggest elements from.
      cmp - the comparator to be used to compare the elements
      Returns:
      a list containing all biggest elements in the array. If the array is null or empty, an empty list is returned.
    • maxAll

      public static <T extends Comparable<? super T>> List<T> maxAll(Iterable<? extends T> c)
      Returns a list containing the biggest elements in the specified iterable based on their natural ordering. Null values are considered to be minimum here.
      Type Parameters:
      T - the type of elements in the input iterable, which must be comparable.
      Parameters:
      a - the iterable to fetch the biggest elements.
      Returns:
      a list containing the biggest elements in the iterable. If the iterable is null or empty, an empty list is returned.
    • maxAll

      public static <T> List<T> maxAll(Iterable<? extends T> c, Comparator<? super T> cmp)
      Returns a list containing all biggest elements in the specified iterable according to the provided comparator.
      Type Parameters:
      T - the type of elements in the input iterable.
      Parameters:
      cmp - the comparator to be used to compare the elements
      a - the iterable to fetch the biggest elements from.
      Returns:
      a list containing all biggest elements in the iterable. If the iterable is null or empty, an empty list is returned.
    • maxAll

      public static <T extends Comparable<? super T>> List<T> maxAll(Iterator<? extends T> iter)
      Returns a list containing the biggest elements in the specified iterator based on their natural ordering. Null values are considered to be minimum here.
      Type Parameters:
      T - the type of elements in the input iterator, which must be comparable.
      Parameters:
      a - the iterator to fetch the biggest elements.
      Returns:
      a list containing the biggest elements in the iterator. If the iterator is null or empty, an empty list is returned.
    • maxAll

      public static <T> List<T> maxAll(Iterator<? extends T> iter, Comparator<? super T> cmp)
      Returns a list containing all biggest elements in the specified iterator according to the provided comparator.
      Type Parameters:
      T - the type of elements in the input iterator.
      Parameters:
      cmp - the comparator to be used to compare the elements
      a - the iterator to fetch the biggest elements from.
      Returns:
      a list containing all biggest elements in the iterator. If the iterator is null or empty, an empty list is returned.
    • maxOrDefaultIfEmpty

      @Beta public static <T, R extends Comparable<? super R>> R maxOrDefaultIfEmpty(T[] a, Function<? super T,? extends R> valueExtractor, R defaultValue)
      Returns the maximum value extracted from the specified array or a default value if the array is null or empty. Null values are considered to be minimum here.
      Type Parameters:
      T - the type of elements in the input array.
      R - the type of the extracted value, which must be comparable.
      Parameters:
      a - the array to extract the maximum value from.
      valueExtractor - the function to extract values from the array elements for comparison.
      defaultValue - the default value to return if the array is null or empty.
      Returns:
      the maximum extracted value or the default value if the array is null or empty.
    • maxOrDefaultIfEmpty

      public static <T, R extends Comparable<? super R>> R maxOrDefaultIfEmpty(Iterable<? extends T> c, Function<? super T,? extends R> valueExtractor, R defaultValue)
      Returns the maximum value extracted from the specified iterable or a default value if the iterable is null or empty. Null values are considered to be minimum here.
      Type Parameters:
      T - the type of elements in the input iterable.
      R - the type of the extracted value, which must be comparable.
      Parameters:
      c - the iterable to extract the maximum value from.
      valueExtractor - the function to extract values from the iterable elements for comparison.
      defaultValue - the default value to return if the iterable is null or empty.
      Returns:
      the maximum extracted value or the default value if the iterable is null or empty.
    • maxOrDefaultIfEmpty

      public static <T, R extends Comparable<? super R>> R maxOrDefaultIfEmpty(Iterator<? extends T> iter, Function<? super T,? extends R> valueExtractor, R defaultValue)
      Returns the maximum value extracted from the specified iterator or a default value if the iterator is null or empty. Null values are considered to be minimum here.
      Type Parameters:
      T - the type of elements in the input iterator.
      R - the type of the extracted value, which must be comparable.
      Parameters:
      iter - the iterator to extract the maximum value from.
      valueExtractor - the function to extract values from the iterator elements for comparison.
      defaultValue - the default value to return if the iterator is null or empty.
      Returns:
      the maximum extracted value or the default value if the iterator is null or empty.
    • maxIntOrDefaultIfEmpty

      @Beta public static <T> int maxIntOrDefaultIfEmpty(T[] a, ToIntFunction<? super T> valueExtractor, int defaultValue)
      Returns the maximum integer value extracted from the array or a default value if the array is null or empty.
      Type Parameters:
      T - the type of elements in the input array.
      Parameters:
      a - the array to extract the maximum integer from.
      valueExtractor - the function to extract integer values from the array elements.
      defaultValue - the default value to return if the array is null or empty.
      Returns:
      the maximum extracted integer value or the default value if the array is null or empty.
    • maxIntOrDefaultIfEmpty

      @Beta public static <T> int maxIntOrDefaultIfEmpty(Iterable<? extends T> c, ToIntFunction<? super T> valueExtractor, int defaultValue)
      Returns the maximum integer value extracted from the iterable or a default value if the iterable is null or empty.
      Type Parameters:
      T - the type of elements in the input iterable.
      Parameters:
      c - the iterable to extract the maximum integer from.
      valueExtractor - the function to extract integer values from the iterable elements.
      defaultValue - the default value to return if the iterable is null or empty.
      Returns:
      the maximum extracted integer value or the default value if the iterable is null or empty.
    • maxIntOrDefaultIfEmpty

      @Beta public static <T> int maxIntOrDefaultIfEmpty(Iterator<? extends T> iter, ToIntFunction<? super T> valueExtractor, int defaultValue)
      Returns the maximum integer value extracted from the iterator or a default value if the iterator is null or empty.
      Type Parameters:
      T - the type of elements in the input iterator.
      Parameters:
      iter - the iterator to extract the maximum integer from.
      valueExtractor - the function to extract integer values from the iterator elements.
      defaultValue - the default value to return if the iterator is null or empty.
      Returns:
      the maximum extracted integer value or the default value if the iterator is null or empty.
    • maxLongOrDefaultIfEmpty

      @Beta public static <T> long maxLongOrDefaultIfEmpty(T[] a, ToLongFunction<? super T> valueExtractor, long defaultValue)
      Returns the maximum long value extracted from the array or a default value if the array is null or empty.
      Type Parameters:
      T - the type of elements in the input array.
      Parameters:
      a - the array to extract the maximum long from.
      valueExtractor - the function to extract long values from the array elements.
      defaultValue - the default value to return if the array is null or empty.
      Returns:
      the maximum extracted long value or the default value if the array is null or empty.
    • maxLongOrDefaultIfEmpty

      @Beta public static <T> long maxLongOrDefaultIfEmpty(Iterable<? extends T> c, ToLongFunction<? super T> valueExtractor, long defaultValue)
      Returns the maximum long value extracted from the iterable or a default value if the iterable is null or empty.
      Type Parameters:
      T - the type of elements in the input iterable.
      Parameters:
      c - the iterable to extract the maximum long from.
      valueExtractor - the function to extract long values from the iterable elements.
      defaultValue - the default value to return if the iterable is null or empty.
      Returns:
      the maximum extracted long value or the default value if the iterable is null or empty.
    • maxLongOrDefaultIfEmpty

      @Beta public static <T> long maxLongOrDefaultIfEmpty(Iterator<? extends T> iter, ToLongFunction<? super T> valueExtractor, long defaultValue)
      Returns the maximum long value extracted from the iterator or a default value if the iterator is null or empty.
      Type Parameters:
      T - the type of elements in the input iterator.
      Parameters:
      iter - the iterator to extract the maximum long from.
      valueExtractor - the function to extract long values from the iterator elements.
      defaultValue - the default value to return if the iterator is null or empty.
      Returns:
      the maximum extracted long value or the default value if the iterator is null or empty.
    • maxDoubleOrDefaultIfEmpty

      @Beta public static <T> double maxDoubleOrDefaultIfEmpty(T[] a, ToDoubleFunction<? super T> valueExtractor, double defaultValue)
      Returns the maximum double value extracted from the array or a default value if the array is null or empty.
      Type Parameters:
      T - the type of elements in the input array.
      Parameters:
      a - the array to extract the maximum double from.
      valueExtractor - the function to extract double values from the array elements.
      defaultValue - the default value to return if the array is null or empty.
      Returns:
      the maximum extracted double value or the default value if the array is null or empty.
    • maxDoubleOrDefaultIfEmpty

      @Beta public static <T> double maxDoubleOrDefaultIfEmpty(Iterable<? extends T> c, ToDoubleFunction<? super T> valueExtractor, double defaultValue)
      Returns the maximum double value extracted from the iterable or a default value if the iterable is null or empty.
      Type Parameters:
      T - the type of elements in the input iterable.
      Parameters:
      c - the iterable to extract the maximum double from.
      valueExtractor - the function to extract double values from the iterable elements.
      defaultValue - the default value to return if the iterable is null or empty.
      Returns:
      the maximum extracted double value or the default value if the iterable is null or empty.
    • maxDoubleOrDefaultIfEmpty

      @Beta public static <T> double maxDoubleOrDefaultIfEmpty(Iterator<? extends T> iter, ToDoubleFunction<? super T> valueExtractor, double defaultValue)
      Returns the maximum double value extracted from the iterator or a default value if the iterator is null or empty.
      Type Parameters:
      T - the type of elements in the input iterator.
      Parameters:
      iter - the iterator to extract the maximum double from.
      valueExtractor - the function to extract double values from the iterator elements.
      defaultValue - the default value to return if the iterator is null or empty.
      Returns:
      the maximum extracted double value or the default value if the iterator is null or empty.
    • median

      public static char median(char a, char b, char c)
      Returns the median value of the three specified char values.
      Parameters:
      a - the first char value.
      b - the second char value.
      c - the third char value.
      Returns:
      the median of the three specified char values.
      See Also:
    • median

      public static byte median(byte a, byte b, byte c)
      Returns the median value of the three specified byte values.
      Parameters:
      a - the first byte value.
      b - the second byte value.
      c - the third byte value.
      Returns:
      the median of the three specified byte values.
      See Also:
    • median

      public static short median(short a, short b, short c)
      Returns the median value of the three specified short values.
      Parameters:
      a - the first short value.
      b - the second short value.
      c - the third short value.
      Returns:
      the median of the three specified short values.
      See Also:
    • median

      public static int median(int a, int b, int c)
      Returns the median value of the three specified int values.
      Parameters:
      a - the first int value.
      b - the second int value.
      c - the third int value.
      Returns:
      the median of the three specified int values.
      See Also:
    • median

      public static long median(long a, long b, long c)
      Returns the median value of the three specified long values.
      Parameters:
      a - the first long value.
      b - the second long value.
      c - the third long value.
      Returns:
      the median of the three specified long values.
      See Also:
    • median

      public static float median(float a, float b, float c)
      Returns the median value of the three specified float values.
      Parameters:
      a - the first float value.
      b - the second float value.
      c - the third float value.
      Returns:
      the median of the three specified float values.
      See Also:
    • median

      public static double median(double a, double b, double c)
      Returns the median value of the three specified double values.
      Parameters:
      a - the first double value.
      b - the second double value.
      c - the third double value.
      Returns:
      the median of the three specified double values.
      See Also:
    • median

      public static <T extends Comparable<? super T>> T median(T a, T b, T c)
      Returns the median of the provided values based on their natural ordering. Null values are considered to be minimum here.
      Type Parameters:
      T - the type of the objects being compared, which must be comparable.
      Parameters:
      a - the first value.
      b - the second value.
      c - the third value.
      Returns:
      the median of the three specified values.
      See Also:
    • median

      public static <T> T median(T a, T b, T c, Comparator<? super T> cmp)
      Returns the median of the provided values according to the provided comparator.
      Type Parameters:
      T - the type of the objects being compared.
      Parameters:
      a - the first value.
      b - the second value.
      c - the third value.
      cmp - the comparator to be used to compare the objects
      Returns:
      the median of the three specified values.
      See Also:
    • median

      @SafeVarargs public static char median(char... a) throws IllegalArgumentException
      Returns the (sizeOfRange / 2 + 1) largest value in the specified array.
      Parameters:
      a - the array of values to find the median of
      Returns:
      the median in the specified array
      Throws:
      IllegalArgumentException - if the array is null or empty
      See Also:
    • median

      public static char median(char[] a, int fromIndex, int toIndex) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the (sizeOfRange / 2 + 1) largest value within the given range in the specified array
      Parameters:
      a - the array of values to find the median of
      fromIndex - The start index (inclusive) of the range
      toIndex - the end index (exclusive) of the range
      Returns:
      the median within the specified range in the input array
      Throws:
      IllegalArgumentException - if the specified array or range is null or empty
      IndexOutOfBoundsException - if the range is out of the array bounds
      See Also:
    • median

      @SafeVarargs public static byte median(byte... a) throws IllegalArgumentException
      Returns the (sizeOfRange / 2 + 1) largest value in the specified array.
      Parameters:
      a - the array of values to find the median of
      Returns:
      the median in the specified array
      Throws:
      IllegalArgumentException - if the array is null or empty
      See Also:
    • median

      public static byte median(byte[] a, int fromIndex, int toIndex) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the (sizeOfRange / 2 + 1) largest value within the given range in the specified array
      Parameters:
      a - the array of values to find the median of
      fromIndex - The start index (inclusive) of the range
      toIndex - the end index (exclusive) of the range
      Returns:
      the median within the specified range in the input array
      Throws:
      IllegalArgumentException - if the specified array or range is null or empty
      IndexOutOfBoundsException - if the range is out of the array bounds
      See Also:
    • median

      @SafeVarargs public static short median(short... a) throws IllegalArgumentException
      Returns the (sizeOfRange / 2 + 1) largest value in the specified array.
      Parameters:
      a - the array of values to find the median of
      Returns:
      the median in the specified array
      Throws:
      IllegalArgumentException - if the array is null or empty
      See Also:
    • median

      public static short median(short[] a, int fromIndex, int toIndex) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the (sizeOfRange / 2 + 1) largest value within the given range in the specified array
      Parameters:
      a - the array of values to find the median of
      fromIndex - The start index (inclusive) of the range
      toIndex - the end index (exclusive) of the range
      Returns:
      the median within the specified range in the input array
      Throws:
      IllegalArgumentException - if the specified array or range is null or empty
      IndexOutOfBoundsException - if the range is out of the array bounds
      See Also:
    • median

      @SafeVarargs public static int median(int... a) throws IllegalArgumentException
      Returns the (sizeOfRange / 2 + 1) largest value in the specified array.
       
       N.media([1]) => 1
       N.media([1, 2]) => 1
       N.media([2, 1]) => 1
       N.media([1, 2, 3]) => 2
       N.media([1, 3, 2]) => 2
       N.media([1, 2, 3, 4]) => 2
       N.media([1, 3, 2, 4]) => 2
       
       
      Parameters:
      a - the array of values to find the median of
      Returns:
      the median in the specified array
      Throws:
      IllegalArgumentException - if the array is null or empty
    • median

      public static int median(int[] a, int fromIndex, int toIndex) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the (sizeOfRange / 2 + 1) largest value within the given range in the specified array
      Parameters:
      a - the array of values to find the median of
      fromIndex - The start index (inclusive) of the range
      toIndex - the end index (exclusive) of the range
      Returns:
      the median within the specified range in the input array
      Throws:
      IllegalArgumentException - if the specified array or range is null or empty
      IndexOutOfBoundsException - if the range is out of the array bounds
      See Also:
    • median

      @SafeVarargs public static long median(long... a) throws IllegalArgumentException
      Returns the (sizeOfRange / 2 + 1) largest value in the specified array.
      Parameters:
      a - the array of values to find the median of
      Returns:
      the median in the specified array
      Throws:
      IllegalArgumentException - if the array is null or empty
      See Also:
    • median

      public static long median(long[] a, int fromIndex, int toIndex) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the (sizeOfRange / 2 + 1) largest value within the given range in the specified array
      Parameters:
      a - the array of values to find the median of
      fromIndex - The start index (inclusive) of the range
      toIndex - the end index (exclusive) of the range
      Returns:
      the median within the specified range in the input array
      Throws:
      IllegalArgumentException - if the specified array or range is null or empty
      IndexOutOfBoundsException - if the range is out of the array bounds
      See Also:
    • median

      @SafeVarargs public static float median(float... a) throws IllegalArgumentException
      Returns the (sizeOfRange / 2 + 1) largest value in the specified array.
      Parameters:
      a - the array of values to find the median of
      Returns:
      the median in the specified array
      Throws:
      IllegalArgumentException - if the array is null or empty
      See Also:
    • median

      public static float median(float[] a, int fromIndex, int toIndex) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the (sizeOfRange / 2 + 1) largest value within the given range in the specified array
      Parameters:
      a - the array of values to find the median of
      fromIndex - The start index (inclusive) of the range
      toIndex - the end index (exclusive) of the range
      Returns:
      the median within the specified range in the input array
      Throws:
      IllegalArgumentException - if the specified array or range is null or empty
      IndexOutOfBoundsException - if the range is out of the array bounds
      See Also:
    • median

      @SafeVarargs public static double median(double... a) throws IllegalArgumentException
      Returns the (sizeOfRange / 2 + 1) largest value in the specified array.
      Parameters:
      a - the array of values to find the median of
      Returns:
      the median in the specified array
      Throws:
      IllegalArgumentException - if the array is null or empty
      See Also:
    • median

      public static double median(double[] a, int fromIndex, int toIndex) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the (sizeOfRange / 2 + 1) largest value within the given range in the specified array
      Parameters:
      a - the array of values to find the median of
      fromIndex - The start index (inclusive) of the range
      toIndex - the end index (exclusive) of the range
      Returns:
      the median within the specified range in the input array
      Throws:
      IllegalArgumentException - if the specified array or range is null or empty
      IndexOutOfBoundsException - if the range is out of the array bounds
      See Also:
    • median

      public static <T extends Comparable<? super T>> T median(T[] a) throws IllegalArgumentException
      Returns the (sizeOfRange / 2 + 1) largest value in the specified array.
      Parameters:
      a - the array of values to find the median of
      Returns:
      the median in the specified array
      Throws:
      IllegalArgumentException - if the array is null or empty
      See Also:
    • median

      public static <T extends Comparable<? super T>> T median(T[] a, int fromIndex, int toIndex) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the (sizeOfRange / 2 + 1) largest value within the given range in the specified array
      Parameters:
      a - the array of values to find the median of
      fromIndex - The start index (inclusive) of the range
      toIndex - the end index (exclusive) of the range
      Returns:
      the median within the specified range in the input array
      Throws:
      IllegalArgumentException - if the specified array or range is null or empty
      IndexOutOfBoundsException - if the range is out of the array bounds
      See Also:
    • median

      public static <T> T median(T[] a, Comparator<? super T> cmp) throws IllegalArgumentException
      Returns the (sizeOfRange / 2 + 1) largest element in the specified array according to the provided comparator.
      Type Parameters:
      T - the type of elements in the input array
      Parameters:
      a - the array of values to find the median of
      cmp - the comparator to determine the order of the values
      Returns:
      the median in the specified array
      Throws:
      IllegalArgumentException - if the array is null or empty
      See Also:
    • median

      public static <T> T median(T[] a, int fromIndex, int toIndex, Comparator<? super T> cmp) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the (sizeOfRange / 2 + 1) largest element within the specified range in the input array according to the provided comparator.
      Type Parameters:
      T - the type of elements in the input array
      Parameters:
      a - the array of values to find the median of
      fromIndex - The start index (inclusive) of the range
      toIndex - the end index (exclusive) of the range
      cmp - the comparator to determine the order of the values
      Returns:
      the median within the specified range in the input array
      Throws:
      IllegalArgumentException - if the specified array or range is null or empty
      IndexOutOfBoundsException - if the range is out of the array bounds
      See Also:
    • median

      public static <T extends Comparable<? super T>> T median(Collection<? extends T> c) throws IllegalArgumentException
      Returns the (sizeOfRange / 2 + 1) largest element in the specified collection according to the provided comparator.
      Type Parameters:
      T - the type of elements in the input collection
      Parameters:
      c - the collection of values to find the median of
      cmp - the comparator to determine the order of the values
      Returns:
      the median in the specified collection
      Throws:
      IllegalArgumentException - if the collection is null or empty
      See Also:
    • median

      public static <T extends Comparable<? super T>> T median(Collection<? extends T> c, int fromIndex, int toIndex) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the (sizeOfRange / 2 + 1) largest element within the specified range in the input collection according to the provided comparator.
      Type Parameters:
      T - the type of elements in the input collection
      Parameters:
      c - the collection of values to find the median of
      fromIndex - The start index (inclusive) of the range to consider in the collection
      toIndex - the end index (exclusive) of the range to consider in the collection
      cmp - the comparator to determine the order of the values
      Returns:
      the median within the specified range in the input collection
      Throws:
      IllegalArgumentException - if the specified collection or range is null or empty
      IndexOutOfBoundsException - if the range is out of the collection bounds
      See Also:
    • median

      public static <T> T median(Collection<? extends T> c, Comparator<? super T> cmp) throws IndexOutOfBoundsException, IllegalArgumentException
      Returns the (sizeOfRange / 2 + 1) largest element in the specified collection according to the provided comparator.
      Type Parameters:
      T - the type of elements in the input collection
      Parameters:
      c - the collection of values to find the median of
      cmp - the comparator to determine the order of the values
      Returns:
      the median in the specified collection
      Throws:
      IllegalArgumentException - if the collection is null or empty
      IndexOutOfBoundsException
      See Also:
    • median

      public static <T> T median(Collection<? extends T> c, int fromIndex, int toIndex, Comparator<? super T> cmp) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the (sizeOfRange / 2 + 1) largest element within the specified range in the input collection according to the provided comparator.
      Type Parameters:
      T - the type of elements in the input collection
      Parameters:
      c - the collection of values to find the median of
      fromIndex - The start index (inclusive) of the range to consider in the collection
      toIndex - the end index (exclusive) of the range to consider in the collection
      cmp - the comparator to determine the order of the values
      Returns:
      the median within the specified range in the input collection
      Throws:
      IllegalArgumentException - if the specified collection or range is null or empty
      IndexOutOfBoundsException - if the range is out of the collection bounds
      See Also:
    • kthLargest

      public static char kthLargest(char[] a, int k) throws IllegalArgumentException
      Returns the k-th largest element in the specified array.
      Parameters:
      a - the array to find the k-th largest element in
      k - the position (1-based) of the largest element to find
      Returns:
      the k-th largest element in the array
      Throws:
      IllegalArgumentException - if the specified array/range is null or empty, its length is less than k
      See Also:
    • kthLargest

      public static char kthLargest(char[] a, int fromIndex, int toIndex, int k) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the k-th largest element within the specified range in the input array.
      Parameters:
      a - the array to find the k-th largest element in
      fromIndex - The start index (inclusive) of the range
      toIndex - the end index (exclusive) of the range
      k - the position (1-based) of the largest element to find
      Returns:
      the k-th largest element within the specified range in the input array
      Throws:
      IllegalArgumentException - if the specified array/range is null or empty, its length is less than k
      IndexOutOfBoundsException - if the range is out of the array bounds
      See Also:
    • kthLargest

      public static byte kthLargest(byte[] a, int k) throws IllegalArgumentException
      Returns the k-th largest element in the specified array.
      Parameters:
      a - the array to find the k-th largest element in
      k - the position (1-based) of the largest element to find
      Returns:
      the k-th largest element in the array
      Throws:
      IllegalArgumentException - if the specified array/range is null or empty, its length is less than k
      See Also:
    • kthLargest

      public static byte kthLargest(byte[] a, int fromIndex, int toIndex, int k) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the k-th largest element within the specified range in the input array.
      Parameters:
      a - the array to find the k-th largest element in
      fromIndex - The start index (inclusive) of the range
      toIndex - the end index (exclusive) of the range
      k - the position (1-based) of the largest element to find
      Returns:
      the k-th largest element within the specified range in the input array
      Throws:
      IllegalArgumentException - if the specified array/range is null or empty, its length is less than k
      IndexOutOfBoundsException - if the range is out of the array bounds
      See Also:
    • kthLargest

      public static short kthLargest(short[] a, int k) throws IllegalArgumentException
      Returns the k-th largest element in the specified array.
      Parameters:
      a - the array to find the k-th largest element in
      k - the position (1-based) of the largest element to find
      Returns:
      the k-th largest element in the array
      Throws:
      IllegalArgumentException - if the specified array/range is null or empty, its length is less than k
      See Also:
    • kthLargest

      public static short kthLargest(short[] a, int fromIndex, int toIndex, int k) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the k-th largest element within the specified range in the input array.
      Parameters:
      a - the array to find the k-th largest element in
      fromIndex - The start index (inclusive) of the range
      toIndex - the end index (exclusive) of the range
      k - the position (1-based) of the largest element to find
      Returns:
      the k-th largest element within the specified range in the input array
      Throws:
      IllegalArgumentException - if the specified array/range is null or empty, its length is less than k
      IndexOutOfBoundsException - if the range is out of the array bounds
      See Also:
    • kthLargest

      public static int kthLargest(int[] a, int k) throws IllegalArgumentException
      Returns the k-th largest element in the specified array.
      Parameters:
      a - the array to find the k-th largest element in
      k - the position (1-based) of the largest element to find
      Returns:
      the k-th largest element in the array
      Throws:
      IllegalArgumentException - if the specified array/range is null or empty, its length is less than k
      See Also:
    • kthLargest

      public static int kthLargest(int[] a, int fromIndex, int toIndex, int k) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the k-th largest element within the specified range in the input array.
      Parameters:
      a - the array to find the k-th largest element in
      fromIndex - The start index (inclusive) of the range
      toIndex - the end index (exclusive) of the range
      k - the position (1-based) of the largest element to find
      Returns:
      the k-th largest element within the specified range in the input array
      Throws:
      IllegalArgumentException - if the specified array/range is null or empty, its length is less than k
      IndexOutOfBoundsException - if the range is out of the array bounds
      See Also:
    • kthLargest

      public static long kthLargest(long[] a, int k) throws IllegalArgumentException
      Returns the k-th largest element in the specified array.
      Parameters:
      a - the array to find the k-th largest element in
      k - the position (1-based) of the largest element to find
      Returns:
      the k-th largest element in the array
      Throws:
      IllegalArgumentException - if the specified array/range is null or empty, its length is less than k
      See Also:
    • kthLargest

      public static long kthLargest(long[] a, int fromIndex, int toIndex, int k) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the k-th largest element within the specified range in the input array.
      Parameters:
      a - the array to find the k-th largest element in
      fromIndex - The start index (inclusive) of the range
      toIndex - the end index (exclusive) of the range
      k - the position (1-based) of the largest element to find
      Returns:
      the k-th largest element within the specified range in the input array
      Throws:
      IllegalArgumentException - if the specified array/range is null or empty, its length is less than k
      IndexOutOfBoundsException - if the range is out of the array bounds
      See Also:
    • kthLargest

      public static float kthLargest(float[] a, int k) throws IllegalArgumentException
      Returns the k-th largest element in the specified array.
      Parameters:
      a - the array to find the k-th largest element in
      k - the position (1-based) of the largest element to find
      Returns:
      the k-th largest element in the array
      Throws:
      IllegalArgumentException - if the specified array/range is null or empty, its length is less than k
      See Also:
    • kthLargest

      public static float kthLargest(float[] a, int fromIndex, int toIndex, int k) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the k-th largest element within the specified range in the input array.
      Parameters:
      a - the array to find the k-th largest element in
      fromIndex - The start index (inclusive) of the range
      toIndex - the end index (exclusive) of the range
      k - the position (1-based) of the largest element to find
      Returns:
      the k-th largest element within the specified range in the input array
      Throws:
      IllegalArgumentException - if the specified array/range is null or empty, its length is less than k
      IndexOutOfBoundsException - if the range is out of the array bounds
      See Also:
    • kthLargest

      public static double kthLargest(double[] a, int k) throws IllegalArgumentException
      Returns the k-th largest element in the specified array.
      Parameters:
      a - the array to find the k-th largest element in
      k - the position (1-based) of the largest element to find
      Returns:
      the k-th largest element in the array
      Throws:
      IllegalArgumentException - if the specified array/range is null or empty, its length is less than k
      See Also:
    • kthLargest

      public static double kthLargest(double[] a, int fromIndex, int toIndex, int k) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the k-th largest element within the specified range in the input array.
      Parameters:
      a - the array to find the k-th largest element in
      fromIndex - The start index (inclusive) of the range
      toIndex - the end index (exclusive) of the range
      k - the position (1-based) of the largest element to find
      Returns:
      the k-th largest element within the specified range in the input array
      Throws:
      IllegalArgumentException - if the specified array/range is null or empty, its length is less than k
      IndexOutOfBoundsException - if the range is out of the array bounds
      See Also:
    • kthLargest

      public static <T extends Comparable<? super T>> T kthLargest(T[] a, int k) throws IllegalArgumentException
      Returns the k-th largest element in the specified array.
      Parameters:
      a - the array to find the k-th largest element in
      k - the position (1-based) of the largest element to find
      Returns:
      the k-th largest element in the array
      Throws:
      IllegalArgumentException - if the specified array/range is null or empty, its length is less than k
      See Also:
    • kthLargest

      public static <T extends Comparable<? super T>> T kthLargest(T[] a, int fromIndex, int toIndex, int k) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the k-th largest element within the specified range in the input array.
      Type Parameters:
      T - The type of the elements in the array. It must be a type that implements Comparable.
      Parameters:
      a - The array from which to find the k-th largest element.
      fromIndex - The start index (inclusive) of the range
      toIndex - the end index (exclusive) of the range
      k - The position from the largest element to return.
      Returns:
      The kth largest element from the array.
      Throws:
      IllegalArgumentException - if the specified array/range is null or empty, its length is less than k
      IndexOutOfBoundsException
      See Also:
    • kthLargest

      public static <T> T kthLargest(T[] a, int k, Comparator<? super T> cmp) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the k-th largest element in the specified array according to the provided comparator.
      Type Parameters:
      T - the type of elements in the input array
      Parameters:
      a - the array to find the k-th largest element in
      k - the position (1-based) of the largest element to find
      cmp - the comparator to determine the order of the array
      Returns:
      the k-th largest element in the array
      Throws:
      IllegalArgumentException - if the specified array/range is null or empty, its length is less than k
      IndexOutOfBoundsException
      See Also:
    • kthLargest

      public static <T> T kthLargest(T[] a, int fromIndex, int toIndex, int k, Comparator<? super T> cmp) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the k-th largest element within the specified range in the input array according to the provided comparator.
      Type Parameters:
      T - The type of the elements in the array.
      Parameters:
      a - The array from which to find the k-th largest element.
      fromIndex - The start index (inclusive) of the range
      toIndex - the end index (exclusive) of the range
      k - The position from the largest element to return.
      cmp - The comparator to determine the order of the array.
      Returns:
      The kth largest element from the array.
      Throws:
      IllegalArgumentException - if the specified array/range is null or empty, its length is less than k
      IndexOutOfBoundsException
      See Also:
    • kthLargest

      public static <T extends Comparable<? super T>> T kthLargest(Collection<? extends T> c, int k) throws IllegalArgumentException
      Returns the k-th largest element in the specified collection.
      Parameters:
      k - the position (1-based) of the largest element to find
      a - the collection to find the k-th largest element in
      Returns:
      the k-th largest element in the array
      Throws:
      IllegalArgumentException - if the specified collection/range is null or empty, its length is less than k
      See Also:
    • kthLargest

      public static <T extends Comparable<? super T>> T kthLargest(Collection<? extends T> c, int fromIndex, int toIndex, int k) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the k-th largest element within the specified range in the input collection.
      Type Parameters:
      T - The type of the elements in the collection.
      Parameters:
      c - The collection from which to find the k-th largest element.
      fromIndex - The start index (inclusive) of the range
      toIndex - the end index (exclusive) of the range
      k - The position from the largest element to return.
      Returns:
      The kth largest element from the collection.
      Throws:
      IllegalArgumentException - if the specified collection/range is null or empty, its length is less than k
      IndexOutOfBoundsException
      See Also:
    • kthLargest

      public static <T> T kthLargest(Collection<? extends T> c, int k, Comparator<? super T> cmp) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the k-th largest element in the specified collection according to the provided comparator.
      Type Parameters:
      T - the type of elements in the input collection
      Parameters:
      c - the collection to find the k-th largest element in
      k - the position (1-based) of the largest element to find
      cmp - the comparator to determine the order of the collection
      Returns:
      the k-th largest element in the collection
      Throws:
      IllegalArgumentException - if the specified collection/range is null or empty, its length is less than k
      IndexOutOfBoundsException
      See Also:
    • kthLargest

      public static <T> T kthLargest(Collection<? extends T> c, int fromIndex, int toIndex, int k, Comparator<? super T> cmp) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the k-th largest element within the specified range in the input collection according to the provided comparator.
      Type Parameters:
      T - The type of the elements in the collection.
      Parameters:
      c - The collection from which to find the k-th largest element.
      fromIndex - The start index (inclusive) of the range
      toIndex - the end index (exclusive) of the range
      k - The position from the largest element to return.
      cmp - The comparator to determine the order of the collection.
      Returns:
      The kth largest element from the collection.
      Throws:
      IllegalArgumentException - if the specified collection/range is null or empty, its length is less than k
      IndexOutOfBoundsException
      See Also:
    • top

      public static short[] top(short[] a, int n)
      Returns the top n elements from the specified array. If there are less than n elements in the array, a copy of the input array is returned.
      Parameters:
      a - the array to find the top n elements in
      n - the number of top elements to return
      Returns:
      an array containing the top n elements
      Throws:
      IllegalArgumentException - if the specified n is negative.
      See Also:
    • top

      public static short[] top(short[] a, int n, Comparator<? super Short> cmp)
      Returns the top n elements from the specified array according to the provided comparator. If there are less than n elements in the array, a copy of the input array is returned.
      Parameters:
      a - the array to find the top n elements in
      n - the number of top elements to return
      cmp - the comparator to determine the order of the array
      Returns:
      an array containing the top n elements
      Throws:
      IllegalArgumentException - if the specified n is negative.
      See Also:
    • top

      public static short[] top(short[] a, int fromIndex, int toIndex, int n) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the top n elements from a specified range in the input array. If there are less than n elements within the specified range, all the elements from the range will be included in the returned array.
      Parameters:
      a - the array to select the top elements from.
      fromIndex - The start index (inclusive) of the range.
      toIndex - The end index (exclusive) of the range.
      n - the number of top elements to select.
      Returns:
      a array containing the top n elements from the specified range in the input array.
      Throws:
      IllegalArgumentException - if the specified n is negative.
      IndexOutOfBoundsException - if the specified range is out of the array's bounds.
      See Also:
    • top

      public static short[] top(short[] a, int fromIndex, int toIndex, int n, Comparator<? super Short> cmp) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the top n elements from a specified range in the input array according to the provided comparator. If there are less than n elements within the specified range, all the elements from the range will be included in the returned array.
      Parameters:
      a - the array to select the top elements from.
      fromIndex - The start index (inclusive) of the range.
      toIndex - The end index (exclusive) of the range.
      n - the number of top elements to select.
      cmp - the comparator to determine the order of the array.
      Returns:
      a array containing the top n elements from the specified range in the input array.
      Throws:
      IllegalArgumentException - if the specified n is negative.
      IndexOutOfBoundsException - if the specified range is out of the array's bounds.
      See Also:
    • top

      public static int[] top(int[] a, int n)
      Returns the top n elements from the specified array. If there are less than n elements in the array, a copy of the input array is returned.
      Parameters:
      a - the array to find the top n elements in
      n - the number of top elements to return
      Returns:
      an array containing the top n elements
      Throws:
      IllegalArgumentException - if the specified n is negative.
    • top

      public static int[] top(int[] a, int n, Comparator<? super Integer> cmp)
      Returns the top n elements from the specified array according to the provided comparator. If there are less than n elements in the array, a copy of the input array is returned.
      Parameters:
      a - the array to find the top n elements in
      n - the number of top elements to return
      cmp - the comparator to determine the order of the array
      Returns:
      an array containing the top n elements
      Throws:
      IllegalArgumentException - if the specified n is negative.
    • top

      public static int[] top(int[] a, int fromIndex, int toIndex, int n) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the top n elements from a specified range in the input array. If there are less than n elements within the specified range, all the elements from the range will be included in the returned array.
      Parameters:
      a - the array to select the top elements from.
      fromIndex - The start index (inclusive) of the range.
      toIndex - The end index (exclusive) of the range.
      n - the number of top elements to select.
      Returns:
      a array containing the top n elements from the specified range in the input array.
      Throws:
      IllegalArgumentException - if the specified n is negative.
      IndexOutOfBoundsException - if the specified range is out of the array's bounds.
      See Also:
    • top

      public static int[] top(int[] a, int fromIndex, int toIndex, int n, Comparator<? super Integer> cmp) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the top n elements from a specified range in the input array according to the provided comparator. If there are less than n elements within the specified range, all the elements from the range will be included in the returned array.
      Parameters:
      a - the array to select the top elements from.
      fromIndex - The start index (inclusive) of the range.
      toIndex - The end index (exclusive) of the range.
      n - the number of top elements to select.
      cmp - the comparator to determine the order of the array.
      Returns:
      a array containing the top n elements from the specified range in the input array.
      Throws:
      IllegalArgumentException - if the specified n is negative.
      IndexOutOfBoundsException - if the specified range is out of the array's bounds.
      See Also:
    • top

      public static long[] top(long[] a, int n)
      Returns the top n elements from the specified array. If there are less than n elements in the array, a copy of the input array is returned.
      Parameters:
      a - the array to find the top n elements in
      n - the number of top elements to return
      Returns:
      an array containing the top n elements
      Throws:
      IllegalArgumentException - if the specified n is negative.
      See Also:
    • top

      public static long[] top(long[] a, int n, Comparator<? super Long> cmp)
      Returns the top n elements from the specified array according to the provided comparator. If there are less than n elements in the array, a copy of the input array is returned.
      Parameters:
      a - the array to find the top n elements in
      n - the number of top elements to return
      cmp - the comparator to determine the order of the array
      Returns:
      an array containing the top n elements
      Throws:
      IllegalArgumentException - if the specified n is negative.
      See Also:
    • top

      public static long[] top(long[] a, int fromIndex, int toIndex, int n) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the top n elements from a specified range in the input array. If there are less than n elements within the specified range, all the elements from the range will be included in the returned array.
      Parameters:
      a - the array to select the top elements from.
      fromIndex - The start index (inclusive) of the range.
      toIndex - The end index (exclusive) of the range.
      n - the number of top elements to select.
      Returns:
      a array containing the top n elements from the specified range in the input array.
      Throws:
      IllegalArgumentException - if the specified n is negative.
      IndexOutOfBoundsException - if the specified range is out of the array's bounds.
      See Also:
    • top

      public static long[] top(long[] a, int fromIndex, int toIndex, int n, Comparator<? super Long> cmp) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the top n elements from a specified range in the input array according to the provided comparator. If there are less than n elements within the specified range, all the elements from the range will be included in the returned array.
      Parameters:
      a - the array to select the top elements from.
      fromIndex - The start index (inclusive) of the range.
      toIndex - The end index (exclusive) of the range.
      n - the number of top elements to select.
      cmp - the comparator to determine the order of the array.
      Returns:
      a array containing the top n elements from the specified range in the input array.
      Throws:
      IllegalArgumentException - if the specified n is negative.
      IndexOutOfBoundsException - if the specified range is out of the array's bounds.
      See Also:
    • top

      public static float[] top(float[] a, int n)
      Returns the top n elements from the specified array. If there are less than n elements in the array, a copy of the input array is returned.
      Parameters:
      a - the array to find the top n elements in
      n - the number of top elements to return
      Returns:
      an array containing the top n elements
      Throws:
      IllegalArgumentException - if the specified n is negative.
      See Also:
    • top

      public static float[] top(float[] a, int n, Comparator<? super Float> cmp)
      Returns the top n elements from the specified array according to the provided comparator. If there are less than n elements in the array, a copy of the input array is returned.
      Parameters:
      a - the array to find the top n elements in
      n - the number of top elements to return
      cmp - the comparator to determine the order of the array
      Returns:
      an array containing the top n elements
      Throws:
      IllegalArgumentException - if the specified n is negative.
      See Also:
    • top

      public static float[] top(float[] a, int fromIndex, int toIndex, int n) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the top n elements from a specified range in the input array. If there are less than n elements within the specified range, all the elements from the range will be included in the returned array.
      Parameters:
      a - the array to select the top elements from.
      fromIndex - The start index (inclusive) of the range.
      toIndex - The end index (exclusive) of the range.
      n - the number of top elements to select.
      Returns:
      a array containing the top n elements from the specified range in the input array.
      Throws:
      IllegalArgumentException - if the specified n is negative.
      IndexOutOfBoundsException - if the specified range is out of the array's bounds.
      See Also:
    • top

      public static float[] top(float[] a, int fromIndex, int toIndex, int n, Comparator<? super Float> cmp) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the top n elements from a specified range in the input array according to the provided comparator. If there are less than n elements within the specified range, all the elements from the range will be included in the returned array.
      Parameters:
      a - the array to select the top elements from.
      fromIndex - The start index (inclusive) of the range.
      toIndex - The end index (exclusive) of the range.
      n - the number of top elements to select.
      cmp - the comparator to determine the order of the array.
      Returns:
      a array containing the top n elements from the specified range in the input array.
      Throws:
      IllegalArgumentException - if the specified n is negative.
      IndexOutOfBoundsException - if the specified range is out of the array's bounds.
      See Also:
    • top

      public static double[] top(double[] a, int n)
      Returns the top n elements from the specified array. If there are less than n elements in the array, a copy of the input array is returned.
      Parameters:
      a - the array to find the top n elements in
      n - the number of top elements to return
      Returns:
      an array containing the top n elements
      Throws:
      IllegalArgumentException - if the specified n is negative.
      See Also:
    • top

      public static double[] top(double[] a, int n, Comparator<? super Double> cmp)
      Returns the top n elements from the specified array according to the provided comparator. If there are less than n elements in the array, a copy of the input array is returned.
      Parameters:
      a - the array to find the top n elements in
      n - the number of top elements to return
      cmp - the comparator to determine the order of the array
      Returns:
      an array containing the top n elements
      Throws:
      IllegalArgumentException - if the specified n is negative.
      See Also:
    • top

      public static double[] top(double[] a, int fromIndex, int toIndex, int n) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the top n elements from a specified range in the input array. If there are less than n elements within the specified range, all the elements from the range will be included in the returned array.
      Parameters:
      a - the array to select the top elements from.
      fromIndex - The start index (inclusive) of the range.
      toIndex - The end index (exclusive) of the range.
      n - the number of top elements to select.
      Returns:
      a array containing the top n elements from the specified range in the input array.
      Throws:
      IllegalArgumentException - if the specified n is negative.
      IndexOutOfBoundsException - if the specified range is out of the array's bounds.
      See Also:
    • top

      public static double[] top(double[] a, int fromIndex, int toIndex, int n, Comparator<? super Double> cmp) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the top n elements from a specified range in the input array according to the provided comparator. If there are less than n elements within the specified range, all the elements from the range will be included in the returned array.
      Parameters:
      a - the array to select the top elements from.
      fromIndex - The start index (inclusive) of the range.
      toIndex - The end index (exclusive) of the range.
      n - the number of top elements to select.
      cmp - the comparator to determine the order of the array.
      Returns:
      a array containing the top n elements from the specified range in the input array.
      Throws:
      IllegalArgumentException - if the specified n is negative.
      IndexOutOfBoundsException - if the specified range is out of the array's bounds.
      See Also:
    • top

      public static <T extends Comparable<? super T>> List<T> top(T[] a, int n)
      Returns the top n elements from the specified array based on their natural ordering. Null values are considered as the smallest elements here. If there are less than n elements in the array, all the elements will be included to returned list.
      Type Parameters:
      T - The type of the elements in the array. It must be a type that implements Comparable.
      Parameters:
      a - The array from which to find the top n elements.
      n - The number of top elements to return.
      Returns:
      A list containing the top n elements from the array.
      Throws:
      IllegalArgumentException - if the specified n is negative.
      See Also:
    • top

      public static <T> List<T> top(T[] a, int n, Comparator<? super T> cmp)
      Returns the top n elements from the specified array according to the provided comparator. If there are less than n elements in the array, all the elements will be included to returned list.
      Type Parameters:
      T - The type of the elements in the array.
      Parameters:
      a - The array from which to find the top n elements.
      n - The number of top elements to return.
      cmp - The Comparator to determine the order of the elements.
      Returns:
      A list containing the top n elements from the array.
      Throws:
      IllegalArgumentException - if the specified n is negative.
      See Also:
    • top

      public static <T extends Comparable<? super T>> List<T> top(T[] a, int fromIndex, int toIndex, int n) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the top n elements from the specified range in the input array based on their natural ordering. Null values are considered as the smallest elements here. If there are less than n elements in the range specified by fromIndex and toIndex, all the elements from that range will be included to returned list.
      Type Parameters:
      T - The type of the elements in the array. It must be a type that implements Comparable.
      Parameters:
      a - The array from which to find the top n elements.
      fromIndex - The start index (inclusive) of the range
      toIndex - the end index (exclusive) of the range
      n - The number of top elements to return.
      Returns:
      A list containing the top n elements from the specified range in the input array.
      Throws:
      IllegalArgumentException - if the specified n is negative.
      IndexOutOfBoundsException - if the specified range is out of the array's bounds.
      See Also:
    • top

      public static <T> List<T> top(T[] a, int fromIndex, int toIndex, int n, Comparator<? super T> cmp) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the top n elements from the specified range in the input array according to the provided comparator. If there are less than n elements in the range, all the elements from that range will be included in the returned list.
      Type Parameters:
      T - The type of the elements in the array.
      Parameters:
      a - The array from which to find the top n elements.
      fromIndex - The start index (inclusive) of the range
      toIndex - the end index (exclusive) of the range
      n - The number of top elements to return.
      cmp - The comparator to determine the order of the elements.
      Returns:
      A list containing the top n elements from the specified range in the input array.
      Throws:
      IllegalArgumentException - if the specified n is negative.
      IndexOutOfBoundsException - if the specified range is out of the array's bounds.
      See Also:
    • top

      public static <T extends Comparable<? super T>> List<T> top(Collection<? extends T> c, int n)
      Returns the top n elements from the specified collection based on their natural ordering. Null values are considered as the smallest elements here. If there are less than n elements in the collection, all the elements will be included to returned list.
      Type Parameters:
      T - The type of the elements in the collection. It must be a type that implements Comparable.
      Parameters:
      n - The number of top elements to return.
      a - The collection from which to find the top n elements.
      Returns:
      A list containing the top n elements from the collection.
      Throws:
      IllegalArgumentException - if the specified n is negative.
      See Also:
    • top

      public static <T> List<T> top(Collection<? extends T> c, int n, Comparator<? super T> cmp)
      Returns the top n elements from the specified collection according to the provided comparator. If there are less than n elements in the collection, all the elements will be included to returned list.
      Type Parameters:
      T - The type of the elements in the collection.
      Parameters:
      n - The number of top elements to return.
      cmp - The comparator to determine the order of the elements.
      a - The collection from which to find the top n elements.
      Returns:
      A list containing the top n elements from the collection.
      Throws:
      IllegalArgumentException - if the specified n is negative.
      See Also:
    • top

      public static <T extends Comparable<? super T>> List<T> top(Collection<? extends T> c, int fromIndex, int toIndex, int n) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the top n elements from the specified range in the input collection based on their natural ordering. Null values are considered as the smallest elements here. If there are less than n elements in the range specified by fromIndex and toIndex, all the elements from that range will be included to returned list.
      Type Parameters:
      T - The type of the elements in the collection. It must be a type that implements Comparable.
      Parameters:
      fromIndex - The start index (inclusive) of the range
      toIndex - the end index (exclusive) of the range
      n - The number of top elements to return.
      a - The collection from which to find the top n elements.
      Returns:
      A list containing the top n elements from the specified range in the input collection.
      Throws:
      IllegalArgumentException - if the specified n is negative.
      IndexOutOfBoundsException - if the specified range is out of the collection's bounds.
      See Also:
    • top

      public static <T> List<T> top(Collection<? extends T> c, int fromIndex, int toIndex, int n, Comparator<? super T> cmp) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the top n elements from the specified range in the input collection according to the provided comparator. If there are less than n elements in the range, all the elements from that range will be included in the returned list.
      Type Parameters:
      T - The type of the elements in the collection.
      Parameters:
      fromIndex - The start index (inclusive) of the range
      toIndex - the end index (exclusive) of the range
      n - The number of top elements to return.
      cmp - The comparator to determine the order of the elements.
      a - The collection from which to find the top n elements.
      Returns:
      A list containing the top n elements from the specified range in the input collection.
      Throws:
      IllegalArgumentException - if the specified n is negative.
      IndexOutOfBoundsException - if the specified range is out of the collection's bounds.
      See Also:
    • top

      public static <T extends Comparable<? super T>> List<T> top(T[] a, int n, boolean keepEncounterOrder)
      Returns the top n elements from the specified array based on their natural ordering. Null values are considered as the smallest elements here. If there are less than n elements in the array, all the elements will be included to returned list. The order of the elements in the returned list is based on their encounter order in the array if keepEncounterOrder is true.
      Type Parameters:
      T - The type of the elements in the array. It must be a type that implements Comparable.
      Parameters:
      a - The array from which to find the top n elements.
      n - The number of top elements to return.
      keepEncounterOrder - If it's true, the encounter order of the elements in the array is preserved in the returned list.
      Returns:
      A list containing the top n elements from the array.
      Throws:
      IllegalArgumentException - if the specified n is negative.
      See Also:
    • top

      public static <T> List<T> top(T[] a, int n, Comparator<? super T> cmp, boolean keepEncounterOrder)
      Returns the top n elements from the specified array according to the provided comparator. If there are less than n elements in the array, all the elements will be included to returned list. The order of the elements in the returned list is based on their encounter order in the array if keepEncounterOrder is true.
      Type Parameters:
      T - The type of the elements in the array.
      Parameters:
      a - The array from which to find the top n elements.
      n - The number of top elements to return.
      cmp - The comparator to determine the order of the elements.
      keepEncounterOrder - If it's true, the encounter order of the elements in the array is preserved in the returned list.
      Returns:
      A list containing the top n elements from the array.
      Throws:
      IllegalArgumentException - if the specified n is negative.
      See Also:
    • top

      public static <T extends Comparable<? super T>> List<T> top(T[] a, int fromIndex, int toIndex, int n, boolean keepEncounterOrder) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the top n elements from the specified range in the input array based on their natural ordering. Null values are considered as the smallest elements here. If there are less than n elements in the range specified by fromIndex and toIndex, all the elements from that range will be included to returned list. The order of the elements in the returned list is based on their encounter order in the array if keepEncounterOrder is true.
      Type Parameters:
      T - The type of the elements in the array. It must be a type that implements Comparable.
      Parameters:
      a - The array from which to find the top n elements.
      fromIndex - The start index (inclusive) of the range
      toIndex - the end index (exclusive) of the range
      n - The number of top elements to return.
      keepEncounterOrder - If it's true, the encounter order of the elements in the array is preserved in the returned list.
      Returns:
      A list containing the top n elements from the specified range in the input array.
      Throws:
      IllegalArgumentException - if the specified n is negative.
      IndexOutOfBoundsException - if the specified range is out of the array's bounds.
      See Also:
    • top

      public static <T> List<T> top(T[] a, int fromIndex, int toIndex, int n, Comparator<? super T> cmp, boolean keepEncounterOrder) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the top n elements from the specified range in the input array according to the provided comparator. If there are less than n elements in the range, all the elements from that range will be included in the returned list. The order of the elements in the returned list is based on their encounter order in the array if keepEncounterOrder is true.
      Type Parameters:
      T - The type of the elements in the array.
      Parameters:
      a - The array from which to find the top n elements.
      fromIndex - The start index (inclusive) of the range
      toIndex - the end index (exclusive) of the range
      n - The number of top elements to return.
      cmp - The comparator to determine the order of the elements.
      keepEncounterOrder - If it's true, the encounter order of the elements in the array is preserved in the returned list.
      Returns:
      A list containing the top n elements from the specified range in the input array.
      Throws:
      IllegalArgumentException - if the specified n is negative.
      IndexOutOfBoundsException - if the specified range is out of the array's bounds.
      See Also:
    • top

      public static <T extends Comparable<? super T>> List<T> top(Collection<? extends T> c, int n, boolean keepEncounterOrder)
      Returns the top n elements from the specified collection based on their natural ordering. Null values are considered as the smallest elements here. If there are less than n elements in the collection, all the elements will be included to returned list. The order of the elements in the returned list is based on their encounter order in the collection if keepEncounterOrder is true.
      Type Parameters:
      T - The type of the elements in the collection. The type must be a subclass of Comparable.
      Parameters:
      c - The collection from which to find the top n elements.
      n - The number of top elements to return.
      keepEncounterOrder - If it's true, the encounter order of the elements in the collection is preserved in the returned list.
      Returns:
      A list containing the top n elements from the collection.
      Throws:
      IllegalArgumentException - if the specified n is negative.
      See Also:
    • top

      public static <T> List<T> top(Collection<? extends T> c, int n, Comparator<? super T> cmp, boolean keepEncounterOrder)
      Returns the top n elements from the specified collection according to the provided comparator. If there are less than n elements in the collection, all the elements will be included to returned list. The order of the elements in the returned list is based on their encounter order in the collection if keepEncounterOrder is true.
      Type Parameters:
      T - The type of the elements in the collection.
      Parameters:
      c - The collection from which to find the top n elements.
      n - The number of top elements to return.
      cmp - The comparator to determine the order of the elements.
      keepEncounterOrder - If it's true, the encounter order of the elements in the collection is preserved in the returned list.
      Returns:
      A list containing the top n elements from the collection.
      Throws:
      IllegalArgumentException - if the specified n is negative.
      See Also:
    • top

      public static <T extends Comparable<? super T>> List<T> top(Collection<? extends T> c, int fromIndex, int toIndex, int n, boolean keepEncounterOrder) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the top n elements from the specified range in the input collection based on their natural ordering. Null values are considered as the smallest elements here. If there are less than n elements in the range specified by fromIndex and toIndex, all the elements from that range will be included to returned list. The order of the elements in the returned list is based on their encounter order in the collection if keepEncounterOrder is true.
      Type Parameters:
      T - The type of the elements in the collection. The type must be a subclass of Comparable.
      Parameters:
      c - The collection from which to find the top n elements.
      fromIndex - The start index (inclusive) of the range
      toIndex - the end index (exclusive) of the range
      n - The number of top elements to return.
      keepEncounterOrder - If it's true, the encounter order of the elements in the collection is preserved in the returned list.
      Returns:
      A list containing the top n elements from the specified range in the input collection.
      Throws:
      IllegalArgumentException - if the specified n is negative.
      IndexOutOfBoundsException - if the specified range is out of the collection's bounds.
      See Also:
    • top

      public static <T> List<T> top(Collection<? extends T> c, int fromIndex, int toIndex, int n, Comparator<? super T> cmp, boolean keepEncounterOrder) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns the top n elements from the specified range in the input collection according to the provided comparator. If there are less than n elements in the range, all the elements from that range will be included in the returned list. The order of the elements in the returned list is based on their encounter order in the collection if keepEncounterOrder is true.
      Type Parameters:
      T - The type of the elements in the collection.
      Parameters:
      c - The collection from which to find the top n elements.
      fromIndex - The start index (inclusive) of the range
      toIndex - the end index (exclusive) of the range
      n - The number of top elements to return.
      cmp - The comparator to determine the order of the elements.
      keepEncounterOrder - If it's true, the encounter order of the elements in the collection is preserved in the returned list.
      Returns:
      A list containing the top n elements from the specified range in the input collection.
      Throws:
      IllegalArgumentException - if the specified n is negative.
      IndexOutOfBoundsException - if the specified range is out of the collection's bounds.
      See Also:
    • percentiles

      public static Map<Percentage,Character> percentiles(char[] sortedArray) throws IllegalArgumentException
      Calculates the percentiles of the provided sorted array of characters.
      Parameters:
      sortedArray - The sorted array of characters for which to calculate the percentiles.
      Returns:
      A map where the keys are the percentiles and the values are the corresponding characters from the array.
      Throws:
      IllegalArgumentException - if the provided array is empty.
      See Also:
    • percentiles

      public static Map<Percentage,Byte> percentiles(byte[] sortedArray) throws IllegalArgumentException
      Calculates the percentiles of the provided sorted array of bytes.
      Parameters:
      sortedArray - The sorted array of bytes for which to calculate the percentiles.
      Returns:
      A map where the keys are the percentiles and the values are the corresponding bytes from the array.
      Throws:
      IllegalArgumentException - if the provided array is empty.
      See Also:
    • percentiles

      public static Map<Percentage,Short> percentiles(short[] sortedArray) throws IllegalArgumentException
      Calculates the percentiles of the provided sorted array of shorts.
      Parameters:
      sortedArray - The sorted array of shorts for which to calculate the percentiles.
      Returns:
      A map where the keys are the percentiles and the values are the corresponding shorts from the array.
      Throws:
      IllegalArgumentException - if the provided array is empty.
      See Also:
    • percentiles

      public static Map<Percentage,Integer> percentiles(int[] sortedArray) throws IllegalArgumentException
      Calculates the percentiles of the provided sorted array of integers.
       
       final int[] sortedArray = Array.range(1, 101);
       final Mapinvalid input: '<'Percentage, Integer> percentiles = N.percentiles(a);
       percentiles.forEach(Fn.println("="));
                           0.0001%=1
                           0.001%=1
                           0.01%=1
                           0.1%=1
                           1%=2
                           2%=3
                           3%=4
                           4%=5
                           5%=6
                           6%=7
                           7%=8
                           8%=9
                           9%=10
                           10%=11
                           20%=21
                           30%=31
                           40%=41
                           50%=51
                           60%=61
                           70%=71
                           80%=81
                           90%=91
                           91%=92
                           92%=93
                           93%=94
                           94%=95
                           95%=96
                           96%=97
                           97%=98
                           98%=99
                           99%=100
                           99.9%=100
                           99.99%=100
                           99.999%=100
                           99.9999%=100
       
       
      Parameters:
      sortedArray - The sorted array of integers for which to calculate the percentiles.
      Returns:
      A map where the keys are the percentiles and the values are the corresponding integers from the array.
      Throws:
      IllegalArgumentException - if the provided array is empty.
    • percentiles

      public static Map<Percentage,Long> percentiles(long[] sortedArray) throws IllegalArgumentException
      Calculates the percentiles of the provided sorted array of longs.
      Parameters:
      sortedArray - The sorted array of longs for which to calculate the percentiles.
      Returns:
      A map where the keys are the percentiles and the values are the corresponding longs from the array.
      Throws:
      IllegalArgumentException - if the provided array is empty.
      See Also:
    • percentiles

      public static Map<Percentage,Float> percentiles(float[] sortedArray) throws IllegalArgumentException
      Calculates the percentiles of the provided sorted array of floats.
      Parameters:
      sortedArray - The sorted array of floats for which to calculate the percentiles.
      Returns:
      A map where the keys are the percentiles and the values are the corresponding floats from the array.
      Throws:
      IllegalArgumentException - if the provided array is empty.
      See Also:
    • percentiles

      public static Map<Percentage,Double> percentiles(double[] sortedArray) throws IllegalArgumentException
      Calculates the percentiles of the provided sorted array of doubles.
      Parameters:
      sortedArray - The sorted array of doubles for which to calculate the percentiles.
      Returns:
      A map where the keys are the percentiles and the values are the corresponding doubles from the array.
      Throws:
      IllegalArgumentException - if the provided array is empty.
      See Also:
    • percentiles

      public static <T> Map<Percentage,T> percentiles(T[] sortedArray) throws IllegalArgumentException
      Calculates the percentiles of the provided sorted array.
      Type Parameters:
      T - The type of elements in the array.
      Parameters:
      sortedArray - The array for which to calculate the percentiles.
      Returns:
      A map where the keys are the percentiles and the values are the corresponding elements from the array.
      Throws:
      IllegalArgumentException - if the provided array is null or empty.
      See Also:
    • percentiles

      public static <T> Map<Percentage,T> percentiles(List<T> sortedList) throws IllegalArgumentException
      Calculates the percentiles of the provided sorted list.
      Type Parameters:
      T - The type of elements in the list.
      Parameters:
      sortedList - The sorted list for which to calculate the percentiles.
      Returns:
      A map where the keys are the percentiles and the values are the corresponding elements from the list.
      Throws:
      IllegalArgumentException - if the provided list is null or empty.
      See Also:
    • filter

      public static boolean[] filter(boolean[] a, BooleanPredicate filter)
      Returns a new array containing only the elements that match the filter predicate. An empty array is returned if the input array is empty.
      Parameters:
      a - the array of boolean values to be filtered
      filter - the predicate used to filter the array
      Returns:
      a new array containing only the elements that match the filter predicate
      See Also:
    • filter

      public static boolean[] filter(boolean[] a, int fromIndex, int toIndex, BooleanPredicate filter) throws IndexOutOfBoundsException
      Returns a new array containing only the elements that match the filter predicate within the specified range in the input array. An empty array is returned if the input array/range is empty.
      Parameters:
      a - the array of characters to be filtered
      fromIndex - The start index (inclusive) of the range.
      toIndex - The end index (exclusive) of the range.
      filter - the predicate used to filter the array
      Returns:
      a a new array containing only the elements that match the filter predicate within the specified range
      Throws:
      IndexOutOfBoundsException - if the specified range is out of the array's bounds.
      See Also:
    • filter

      public static char[] filter(char[] a, CharPredicate filter)
      Returns a new array containing only the elements that match the filter predicate. An empty array is returned if the input array is empty.
      Parameters:
      a - the array of characters to be filtered
      filter - the predicate used to filter the array
      Returns:
      a new array containing only the elements that match the filter predicate
      See Also:
    • filter

      public static char[] filter(char[] a, int fromIndex, int toIndex, CharPredicate filter) throws IndexOutOfBoundsException
      Returns a new array containing only the elements that match the filter predicate within the specified range in the input array. An empty array is returned if the input array/range is empty.
      Parameters:
      a - the array of characters to be filtered
      fromIndex - The start index (inclusive) of the range.
      toIndex - The end index (exclusive) of the range.
      filter - the predicate used to filter the array
      Returns:
      a a new array containing only the elements that match the filter predicate within the specified range
      Throws:
      IndexOutOfBoundsException - if the specified range is out of the array's bounds.
      See Also:
    • filter

      public static byte[] filter(byte[] a, BytePredicate filter)
      Returns a new array containing only the elements that match the filter predicate. An empty array is returned if the input array is empty.
      Parameters:
      a - the array of bytes to be filtered
      filter - the predicate used to filter the array
      Returns:
      a new array containing only the elements that match the filter predicate
      See Also:
    • filter

      public static byte[] filter(byte[] a, int fromIndex, int toIndex, BytePredicate filter) throws IndexOutOfBoundsException
      Returns a new array containing only the elements that match the filter predicate within the specified range in the input array. An empty array is returned if the input array/range is empty.
      Parameters:
      a - the array of bytes to be filtered
      fromIndex - The start index (inclusive) of the range.
      toIndex - The end index (exclusive) of the range.
      filter - the predicate used to filter the array
      Returns:
      a a new array containing only the elements that match the filter predicate within the specified range
      Throws:
      IndexOutOfBoundsException - if the specified range is out of the array's bounds.
      See Also:
    • filter

      public static short[] filter(short[] a, ShortPredicate filter)
      Returns a new array containing only the elements that match the filter predicate. An empty array is returned if the input array is empty.
      Parameters:
      a - the array of short values to be filtered
      filter - the predicate used to filter the array
      Returns:
      a new array containing only the elements that match the filter predicate
      See Also:
    • filter

      public static short[] filter(short[] a, int fromIndex, int toIndex, ShortPredicate filter) throws IndexOutOfBoundsException
      Returns a new array containing only the elements that match the filter predicate within the specified range in the input array. An empty array is returned if the input array/range is empty.
      Parameters:
      a - the array of short values to be filtered
      fromIndex - The start index (inclusive) of the range.
      toIndex - The end index (exclusive) of the range.
      filter - the predicate used to filter the array
      Returns:
      a a new array containing only the elements that match the filter predicate within the specified range
      Throws:
      IndexOutOfBoundsException - if the specified range is out of the array's bounds.
      See Also:
    • filter

      public static int[] filter(int[] a, IntPredicate filter)
      Returns a new array containing only the elements that match the filter predicate. An empty array is returned if the input array is empty.
      Parameters:
      a - the array of int values to be filtered
      filter - the predicate used to filter the array
      Returns:
      a new array containing only the elements that match the filter predicate
      See Also:
    • filter

      public static int[] filter(int[] a, int fromIndex, int toIndex, IntPredicate filter) throws IndexOutOfBoundsException
      Returns a new array containing only the elements that match the filter predicate within the specified range in the input array. An empty array is returned if the input array/range is empty.
      Parameters:
      a - the array of int values to be filtered
      fromIndex - The start index (inclusive) of the range.
      toIndex - The end index (exclusive) of the range.
      filter - the predicate used to filter the array
      Returns:
      a a new array containing only the elements that match the filter predicate within the specified range
      Throws:
      IndexOutOfBoundsException - if the specified range is out of the array's bounds.
      See Also:
    • filter

      public static long[] filter(long[] a, LongPredicate filter)
      Returns a new array containing only the elements that match the filter predicate. An empty array is returned if the input array is empty.
      Parameters:
      a - the array of long values to be filtered
      filter - the predicate used to filter the array
      Returns:
      a new array containing only the elements that match the filter predicate
      See Also:
    • filter

      public static long[] filter(long[] a, int fromIndex, int toIndex, LongPredicate filter) throws IndexOutOfBoundsException
      Returns a new array containing only the elements that match the filter predicate within the specified range in the input array. An empty array is returned if the input array/range is empty.
      Parameters:
      a - the array of long values to be filtered
      fromIndex - The start index (inclusive) of the range.
      toIndex - The end index (exclusive) of the range.
      filter - the predicate used to filter the array
      Returns:
      a a new array containing only the elements that match the filter predicate within the specified range
      Throws:
      IndexOutOfBoundsException - if the specified range is out of the array's bounds.
      See Also:
    • filter

      public static float[] filter(float[] a, FloatPredicate filter)
      Returns a new array containing only the elements that match the filter predicate. An empty array is returned if the input array is empty.
      Parameters:
      a - the array of float values to be filtered
      filter - the predicate used to filter the array
      Returns:
      a new array containing only the elements that match the filter predicate
      See Also:
    • filter

      public static float[] filter(float[] a, int fromIndex, int toIndex, FloatPredicate filter) throws IndexOutOfBoundsException
      Returns a new array containing only the elements that match the filter predicate within the specified range in the input array. An empty array is returned if the input array/range is empty.
      Parameters:
      a - the array of float values to be filtered
      fromIndex - The start index (inclusive) of the range.
      toIndex - The end index (exclusive) of the range.
      filter - the predicate used to filter the array
      Returns:
      a a new array containing only the elements that match the filter predicate within the specified range
      Throws:
      IndexOutOfBoundsException - if the specified range is out of the array's bounds.
      See Also:
    • filter

      public static double[] filter(double[] a, DoublePredicate filter)
      Returns a new array containing only the elements that match the filter predicate. An empty array is returned if the input array is empty.
      Parameters:
      a - the array of double values to be filtered
      filter - the predicate used to filter the array
      Returns:
      a new array containing only the elements that match the filter predicate
      See Also:
    • filter

      public static double[] filter(double[] a, int fromIndex, int toIndex, DoublePredicate filter) throws IndexOutOfBoundsException
      Returns a new array containing only the elements that match the filter predicate within the specified range in the input array. An empty array is returned if the input array/range is empty.
      Parameters:
      a - the array of double values to be filtered
      fromIndex - The start index (inclusive) of the range.
      toIndex - The end index (exclusive) of the range.
      filter - the predicate used to filter the array
      Returns:
      a a new array containing only the elements that match the filter predicate within the specified range
      Throws:
      IndexOutOfBoundsException - if the specified range is out of the array's bounds.
      See Also:
    • filter

      public static <T> List<T> filter(T[] a, Predicate<? super T> filter)
      Returns a new list containing only the elements that match the filter predicate. An empty list is returned if the input array is empty.
      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the array of values to be filtered
      filter - the predicate used to filter the array
      Returns:
      a new list containing only the elements that match the filter predicate
      See Also:
    • filter

      public static <T, C extends Collection<T>> C filter(T[] a, Predicate<? super T> filter, IntFunction<C> supplier) throws IndexOutOfBoundsException
      Returns a new collection containing only the elements that match the filter predicate. An empty collection is returned if the input array is empty. The collection is created by the provided supplier function.
      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the array of values to be filtered
      filter - the predicate used to filter the array
      supplier - the supplier function that provides a new collection to store the filtered elements
      Returns:
      a new collection containing only the elements that match the filter predicate
      Throws:
      IndexOutOfBoundsException
      See Also:
    • filter

      public static <T> List<T> filter(T[] a, int fromIndex, int toIndex, Predicate<? super T> filter) throws IndexOutOfBoundsException
      Returns a new list containing only the elements that match the filter predicate within the specified range in the input array. An empty list is returned if the input array/range is empty.
      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the array of values to be filtered
      fromIndex - The start index (inclusive) of the range.
      toIndex - The end index (exclusive) of the range.
      filter - the predicate used to filter the array
      Returns:
      a new list containing only the elements that match the filter predicate within the specified range
      Throws:
      IndexOutOfBoundsException - if the specified range is out of the array's bounds.
      See Also:
    • filter

      public static <T, C extends Collection<T>> C filter(T[] a, int fromIndex, int toIndex, Predicate<? super T> filter, IntFunction<C> supplier) throws IndexOutOfBoundsException
      Returns a new collection containing only the elements that match the filter predicate within the specified range in the input array. An empty collection is returned if the input array/range is empty. The collection is created by the provided supplier function.
      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the array of values to be filtered
      fromIndex - The start index (inclusive) of the range.
      toIndex - The end index (exclusive) of the range.
      filter - the predicate used to filter the array
      supplier - the supplier function that provides a new collection to store the filtered elements
      Returns:
      a new collection containing only the elements that match the filter predicate within the specified range
      Throws:
      IndexOutOfBoundsException - if the specified range is out of the array's bounds.
      See Also:
    • filter

      public static <T> List<T> filter(Collection<? extends T> c, int fromIndex, int toIndex, Predicate<? super T> filter) throws IndexOutOfBoundsException
      Returns a new list containing only the elements that match the filter predicate within the specified range in the input collection. An empty list is returned if the input collection/range is empty.
      Type Parameters:
      T - the type of the elements in the collection
      Parameters:
      c - the collection of values to be filtered
      fromIndex - The start index (inclusive) of the range.
      toIndex - The end index (exclusive) of the range.
      filter - the predicate used to filter the collection
      Returns:
      a new list containing only the elements that match the filter predicate within the specified range
      Throws:
      IndexOutOfBoundsException - if the specified range is out of the collection's bounds.
      See Also:
    • filter

      public static <T, C extends Collection<T>> C filter(Collection<? extends T> c, int fromIndex, int toIndex, Predicate<? super T> filter, IntFunction<C> supplier) throws IndexOutOfBoundsException
      Returns a new collection containing only the elements that match the filter predicate within the specified range in the input collection. An empty collection is returned if the input collection/range is empty. The collection is created by the provided supplier function.
      Type Parameters:
      T - the type of the elements in the collection
      Parameters:
      c - the collection of values to be filtered
      fromIndex - The start index (inclusive) of the range.
      toIndex - The end index (exclusive) of the range.
      filter - the predicate used to filter the collection
      supplier - the supplier function that provides a new collection to store the filtered elements
      Returns:
      a new collection containing only the elements that match the filter predicate within the specified range
      Throws:
      IndexOutOfBoundsException - if the specified range is out of the collection's bounds.
      See Also:
    • filter

      public static <T> List<T> filter(Iterable<? extends T> c, Predicate<? super T> filter)
      Returns a new list containing only the elements that match the filter predicate. An empty list is returned if the input collection is empty.
      Type Parameters:
      T - the type of the elements in the iterable
      Parameters:
      c - the iterable of values to be filtered
      filter - the predicate used to filter the iterable
      Returns:
      a new list containing only the elements that match the filter predicate
      See Also:
    • filter

      public static <T, C extends Collection<T>> C filter(Iterable<? extends T> c, Predicate<? super T> filter, IntFunction<C> supplier)
      Returns a new collection containing only the elements that match the filter predicate. An empty collection is returned if the input collection is empty. The collection is created by the provided supplier function.
      Type Parameters:
      T - the type of the elements in the iterable
      Parameters:
      c - the iterable of values to be filtered
      filter - the predicate used to filter the iterable
      supplier - the supplier function that provides a new collection to store the filtered elements
      Returns:
      a new collection containing only the elements that match the filter predicate
      See Also:
    • filter

      public static <T> List<T> filter(Iterator<? extends T> iter, Predicate<? super T> filter)
      Returns a new list containing only the elements that match the filter predicate. An empty list is returned if the input iterator is empty.
      Type Parameters:
      T - the type of the elements in the iterator
      Parameters:
      iter - the iterator of values to be filtered
      filter - the predicate used to filter the iterator
      Returns:
      a new list containing only the elements that match the filter predicate
      See Also:
    • filter

      public static <T, C extends Collection<T>> C filter(Iterator<? extends T> iter, Predicate<? super T> filter, IntFunction<C> supplier)
      Returns a new collection containing only the elements that match the filter predicate. An empty collection is returned if the input iterator is empty. The collection is created by the provided supplier function.
      Type Parameters:
      T - the type of the elements in the iterator
      Parameters:
      iter - the iterator of values to be filtered
      filter - the predicate used to filter the iterator
      supplier - the supplier function that provides a new collection to store the filtered elements
      Returns:
      a new collection containing only the elements that match the filter predicate
      See Also:
    • mapToBoolean

      public static <T> boolean[] mapToBoolean(T[] a, ToBooleanFunction<? super T> mapper)
      Transforms the elements of the specified array to boolean values using the specified ToBooleanFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the array of values to be mapped
      mapper - the function used to map the elements to boolean values
      Returns:
      a new boolean array containing the mapped values, or an empty boolean array if the input array is null or empty
      See Also:
    • mapToBoolean

      public static <T> boolean[] mapToBoolean(T[] a, int fromIndex, int toIndex, ToBooleanFunction<? super T> mapper) throws IndexOutOfBoundsException
      Transforms the elements within the specified range in the input array to boolean values using the specified ToBooleanFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the array of values to be mapped
      fromIndex - the starting index (inclusive) of the range to be mapped
      toIndex - the ending index (exclusive) of the range to be mapped
      mapper - the function used to map the elements to boolean values
      Returns:
      a new boolean array containing the mapped values, or an empty boolean array if the input array/range is null or empty
      Throws:
      IndexOutOfBoundsException - the specified range is out of the array's bounds.
      See Also:
    • mapToBoolean

      public static <T> boolean[] mapToBoolean(Collection<? extends T> c, ToBooleanFunction<? super T> mapper)
      Transforms the elements of the specified collection to boolean values using the specified ToBooleanFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the collection
      Parameters:
      mapper - the function used to map the elements to boolean values
      a - the collection of values to be mapped
      Returns:
      a new boolean array containing the mapped values, or an empty boolean collection if the input array is null or empty
      See Also:
    • mapToBoolean

      public static <T> boolean[] mapToBoolean(Collection<? extends T> c, int fromIndex, int toIndex, ToBooleanFunction<? super T> mapper) throws IndexOutOfBoundsException
      Transforms the elements within the specified range in the input collection to boolean values using the specified ToBooleanFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the collection
      Parameters:
      fromIndex - the starting index (inclusive) of the range to be mapped
      toIndex - the ending index (exclusive) of the range to be mapped
      mapper - the function used to map the elements to boolean values
      a - the collection of values to be mapped
      Returns:
      a new boolean array containing the mapped values, or an empty boolean array if the input collection/range is null or empty
      Throws:
      IndexOutOfBoundsException - the specified range is out of the collection's bounds.
      See Also:
    • mapToChar

      public static <T> char[] mapToChar(T[] a, ToCharFunction<? super T> mapper)
      Transforms the elements of the specified array to char values using the specified ToCharFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the array of values to be mapped
      mapper - the function used to map the elements to char values
      Returns:
      a new char array containing the mapped values, or an empty char array if the input array is null or empty
      See Also:
    • mapToChar

      public static <T> char[] mapToChar(T[] a, int fromIndex, int toIndex, ToCharFunction<? super T> mapper) throws IndexOutOfBoundsException
      Transforms the elements within the specified range in the input array to char values using the specified ToCharFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the array of values to be mapped
      fromIndex - the starting index (inclusive) of the range to be mapped
      toIndex - the ending index (exclusive) of the range to be mapped
      mapper - the function used to map the elements to char values
      Returns:
      a new char array containing the mapped values, or an empty char array if the input array/range is null or empty
      Throws:
      IndexOutOfBoundsException - the specified range is out of the array's bounds.
      See Also:
    • mapToChar

      public static <T> char[] mapToChar(Collection<? extends T> c, ToCharFunction<? super T> mapper)
      Transforms the elements of the specified collection to char values using the specified ToCharFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the collection
      Parameters:
      mapper - the function used to map the elements to char values
      a - the collection of values to be mapped
      Returns:
      a new char array containing the mapped values, or an empty char collection if the input array is null or empty
      See Also:
    • mapToChar

      public static <T> char[] mapToChar(Collection<? extends T> c, int fromIndex, int toIndex, ToCharFunction<? super T> mapper) throws IndexOutOfBoundsException
      Transforms the elements within the specified range in the input collection to char values using the specified ToCharFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the collection
      Parameters:
      fromIndex - the starting index (inclusive) of the range to be mapped
      toIndex - the ending index (exclusive) of the range to be mapped
      mapper - the function used to map the elements to char values
      a - the collection of values to be mapped
      Returns:
      a new char array containing the mapped values, or an empty char array if the input collection/range is null or empty
      Throws:
      IndexOutOfBoundsException - the specified range is out of the collection's bounds.
      See Also:
    • mapToByte

      public static <T> byte[] mapToByte(T[] a, ToByteFunction<? super T> mapper)
      Transforms the elements of the specified array to byte values using the specified ToByteFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the array of values to be mapped
      mapper - the function used to map the elements to byte values
      Returns:
      a new byte array containing the mapped values, or an empty byte array if the input array is null or empty
      See Also:
    • mapToByte

      public static <T> byte[] mapToByte(T[] a, int fromIndex, int toIndex, ToByteFunction<? super T> mapper) throws IndexOutOfBoundsException
      Transforms the elements within the specified range in the input array to byte values using the specified ToByteFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the array of values to be mapped
      fromIndex - the starting index (inclusive) of the range to be mapped
      toIndex - the ending index (exclusive) of the range to be mapped
      mapper - the function used to map the elements to byte values
      Returns:
      a new byte array containing the mapped values, or an empty byte array if the input array/range is null or empty
      Throws:
      IndexOutOfBoundsException - the specified range is out of the array's bounds.
      See Also:
    • mapToByte

      public static <T> byte[] mapToByte(Collection<? extends T> c, ToByteFunction<? super T> mapper)
      Transforms the elements of the specified collection to byte values using the specified ToByteFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the collection
      Parameters:
      mapper - the function used to map the elements to byte values
      a - the collection of values to be mapped
      Returns:
      a new byte array containing the mapped values, or an empty byte collection if the input array is null or empty
      See Also:
    • mapToByte

      public static <T> byte[] mapToByte(Collection<? extends T> c, int fromIndex, int toIndex, ToByteFunction<? super T> mapper) throws IndexOutOfBoundsException
      Transforms the elements within the specified range in the input collection to byte values using the specified ToByteFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the collection
      Parameters:
      fromIndex - the starting index (inclusive) of the range to be mapped
      toIndex - the ending index (exclusive) of the range to be mapped
      mapper - the function used to map the elements to byte values
      a - the collection of values to be mapped
      Returns:
      a new byte array containing the mapped values, or an empty byte array if the input collection/range is null or empty
      Throws:
      IndexOutOfBoundsException - the specified range is out of the collection's bounds.
      See Also:
    • mapToShort

      public static <T> short[] mapToShort(T[] a, ToShortFunction<? super T> mapper)
      Transforms the elements of the specified array to short values using the specified ToShortFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the array of values to be mapped
      mapper - the function used to map the elements to short values
      Returns:
      a new short array containing the mapped values, or an empty short array if the input array is null or empty
      See Also:
    • mapToShort

      public static <T> short[] mapToShort(T[] a, int fromIndex, int toIndex, ToShortFunction<? super T> mapper) throws IndexOutOfBoundsException
      Transforms the elements within the specified range in the input array to short values using the specified ToShortFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the array of values to be mapped
      fromIndex - the starting index (inclusive) of the range to be mapped
      toIndex - the ending index (exclusive) of the range to be mapped
      mapper - the function used to map the elements to short values
      Returns:
      a new short array containing the mapped values, or an empty short array if the input array/range is null or empty
      Throws:
      IndexOutOfBoundsException - the specified range is out of the array's bounds.
      See Also:
    • mapToShort

      public static <T> short[] mapToShort(Collection<? extends T> c, ToShortFunction<? super T> mapper)
      Transforms the elements of the specified collection to short values using the specified ToShortFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the collection
      Parameters:
      mapper - the function used to map the elements to short values
      a - the collection of values to be mapped
      Returns:
      a new short array containing the mapped values, or an empty short collection if the input array is null or empty
      See Also:
    • mapToShort

      public static <T> short[] mapToShort(Collection<? extends T> c, int fromIndex, int toIndex, ToShortFunction<? super T> mapper) throws IndexOutOfBoundsException
      Transforms the elements within the specified range in the input collection to short values using the specified ToShortFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the collection
      Parameters:
      fromIndex - the starting index (inclusive) of the range to be mapped
      toIndex - the ending index (exclusive) of the range to be mapped
      mapper - the function used to map the elements to short values
      a - the collection of values to be mapped
      Returns:
      a new short array containing the mapped values, or an empty short array if the input collection/range is null or empty
      Throws:
      IndexOutOfBoundsException - the specified range is out of the collection's bounds.
      See Also:
    • mapToInt

      public static <T> int[] mapToInt(T[] a, ToIntFunction<? super T> mapper)
      Transforms the elements of the specified array to int values using the specified ToIntFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the array of values to be mapped
      mapper - the function used to map the elements to int values
      Returns:
      a new int array containing the mapped values, or an empty int array if the input array is null or empty
    • mapToInt

      public static <T> int[] mapToInt(T[] a, int fromIndex, int toIndex, ToIntFunction<? super T> mapper) throws IndexOutOfBoundsException
      Transforms the elements within the specified range in the input array to int values using the specified ToIntFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the array of values to be mapped
      fromIndex - the starting index (inclusive) of the range to be mapped
      toIndex - the ending index (exclusive) of the range to be mapped
      mapper - the function used to map the elements to int values
      Returns:
      a new int array containing the mapped values, or an empty int array if the input array/range is null or empty
      Throws:
      IndexOutOfBoundsException - the specified range is out of the array's bounds.
      See Also:
    • mapToInt

      public static <T> int[] mapToInt(Collection<? extends T> c, ToIntFunction<? super T> mapper)
      Transforms the elements of the specified collection to int values using the specified ToIntFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the collection
      Parameters:
      mapper - the function used to map the elements to int values
      a - the collection of values to be mapped
      Returns:
      a new int array containing the mapped values, or an empty int collection if the input array is null or empty
      See Also:
    • mapToInt

      public static <T> int[] mapToInt(Collection<? extends T> c, int fromIndex, int toIndex, ToIntFunction<? super T> mapper) throws IndexOutOfBoundsException
      Transforms the elements within the specified range in the input collection to int values using the specified ToIntFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the collection
      Parameters:
      fromIndex - the starting index (inclusive) of the range to be mapped
      toIndex - the ending index (exclusive) of the range to be mapped
      mapper - the function used to map the elements to int values
      a - the collection of values to be mapped
      Returns:
      a new int array containing the mapped values, or an empty int array if the input collection/range is null or empty
      Throws:
      IndexOutOfBoundsException - the specified range is out of the collection's bounds.
      See Also:
    • mapToInt

      @Beta public static int[] mapToInt(long[] a, LongToIntFunction mapper)
      Transforms the long values in the specified array to int values using the specified LongToIntFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Parameters:
      a - the array of long values to be mapped
      mapper - the function used to map the long values to int values
      Returns:
      a new int array containing the mapped values, or an empty int array if the input array is null or empty
    • mapToInt

      @Beta public static int[] mapToInt(double[] a, DoubleToIntFunction mapper)
      Transforms the double values in the specified array to int values using the specified DoubleToIntFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Parameters:
      a - the array of double values to be mapped
      mapper - the function used to map the double values to int values
      Returns:
      a new int array containing the mapped values, or an empty int array if the input array is null or empty
    • mapToLong

      public static <T> long[] mapToLong(T[] a, ToLongFunction<? super T> mapper)
      Transforms the elements of the specified array to long values using the specified ToLongFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the array of values to be mapped
      mapper - the function used to map the elements to long values
      Returns:
      a new long array containing the mapped values, or an empty long array if the input array is null or empty
    • mapToLong

      public static <T> long[] mapToLong(T[] a, int fromIndex, int toIndex, ToLongFunction<? super T> mapper) throws IndexOutOfBoundsException
      Transforms the elements within the specified range in the input array to long values using the specified ToLongFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the array of values to be mapped
      fromIndex - the starting index (inclusive) of the range to be mapped
      toIndex - the ending index (exclusive) of the range to be mapped
      mapper - the function used to map the elements to long values
      Returns:
      a new long array containing the mapped values, or an empty long array if the input array/range is null or empty
      Throws:
      IndexOutOfBoundsException - the specified range is out of the array's bounds.
      See Also:
    • mapToLong

      public static <T> long[] mapToLong(Collection<? extends T> c, ToLongFunction<? super T> mapper)
      Transforms the elements of the specified collection to long values using the specified ToLongFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the collection
      Parameters:
      mapper - the function used to map the elements to long values
      a - the collection of values to be mapped
      Returns:
      a new long array containing the mapped values, or an empty long collection if the input array is null or empty
      See Also:
    • mapToLong

      public static <T> long[] mapToLong(Collection<? extends T> c, int fromIndex, int toIndex, ToLongFunction<? super T> mapper) throws IndexOutOfBoundsException
      Transforms the elements within the specified range in the input collection to long values using the specified ToLongFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the collection
      Parameters:
      fromIndex - the starting index (inclusive) of the range to be mapped
      toIndex - the ending index (exclusive) of the range to be mapped
      mapper - the function used to map the elements to long values
      a - the collection of values to be mapped
      Returns:
      a new long array containing the mapped values, or an empty long array if the input collection/range is null or empty
      Throws:
      IndexOutOfBoundsException - the specified range is out of the collection's bounds.
      See Also:
    • mapToLong

      @Beta public static long[] mapToLong(int[] a, IntToLongFunction mapper)
      Transforms the int values in the specified array to long values using the specified IntToLongFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Parameters:
      a - the array of int values to be mapped
      mapper - the function used to map the int values to long values
      Returns:
      a new long array containing the mapped values, or an empty long array if the input array is null or empty
    • mapToLong

      @Beta public static long[] mapToLong(double[] a, DoubleToLongFunction mapper)
      Transforms the double values in the specified array to long values using the specified DoubleToLongFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Parameters:
      a - the array of double values to be mapped
      mapper - the function used to map the double values to long values
      Returns:
      a new long array containing the mapped values, or an empty long array if the input array is null or empty
    • mapToFloat

      public static <T> float[] mapToFloat(T[] a, ToFloatFunction<? super T> mapper)
      Transforms the elements of the specified array to float values using the specified ToFloatFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the array of values to be mapped
      mapper - the function used to map the elements to float values
      Returns:
      a new float array containing the mapped values, or an empty float array if the input array is null or empty
    • mapToFloat

      public static <T> float[] mapToFloat(T[] a, int fromIndex, int toIndex, ToFloatFunction<? super T> mapper) throws IndexOutOfBoundsException
      Transforms the elements within the specified range in the input array to float values using the specified ToFloatFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the array of values to be mapped
      fromIndex - the starting index (inclusive) of the range to be mapped
      toIndex - the ending index (exclusive) of the range to be mapped
      mapper - the function used to map the elements to float values
      Returns:
      a new float array containing the mapped values, or an empty float array if the input array/range is null or empty
      Throws:
      IndexOutOfBoundsException - the specified range is out of the array's bounds.
      See Also:
    • mapToFloat

      public static <T> float[] mapToFloat(Collection<? extends T> c, ToFloatFunction<? super T> mapper)
      Transforms the elements of the specified collection to float values using the specified ToFloatFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the collection
      Parameters:
      mapper - the function used to map the elements to float values
      a - the collection of values to be mapped
      Returns:
      a new float array containing the mapped values, or an empty float collection if the input array is null or empty
      See Also:
    • mapToFloat

      public static <T> float[] mapToFloat(Collection<? extends T> c, int fromIndex, int toIndex, ToFloatFunction<? super T> mapper) throws IndexOutOfBoundsException
      Transforms the elements within the specified range in the input collection to float values using the specified ToFloatFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the collection
      Parameters:
      fromIndex - the starting index (inclusive) of the range to be mapped
      toIndex - the ending index (exclusive) of the range to be mapped
      mapper - the function used to map the elements to float values
      a - the collection of values to be mapped
      Returns:
      a new float array containing the mapped values, or an empty float array if the input collection/range is null or empty
      Throws:
      IndexOutOfBoundsException - the specified range is out of the collection's bounds.
      See Also:
    • mapToDouble

      public static <T> double[] mapToDouble(T[] a, ToDoubleFunction<? super T> mapper)
      Transforms the elements of the specified array to double values using the specified ToDoubleFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the array of values to be mapped
      mapper - the function used to map the elements to double values
      Returns:
      a new double array containing the mapped values, or an empty double array if the input array is null or empty
    • mapToDouble

      public static <T> double[] mapToDouble(T[] a, int fromIndex, int toIndex, ToDoubleFunction<? super T> mapper) throws IndexOutOfBoundsException
      Transforms the elements within the specified range in the input array to double values using the specified ToDoubleFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the array of values to be mapped
      fromIndex - the starting index (inclusive) of the range to be mapped
      toIndex - the ending index (exclusive) of the range to be mapped
      mapper - the function used to map the elements to double values
      Returns:
      a new double array containing the mapped values, or an empty double array if the input array/range is null or empty
      Throws:
      IndexOutOfBoundsException - the specified range is out of the array's bounds.
      See Also:
    • mapToDouble

      public static <T> double[] mapToDouble(Collection<? extends T> c, ToDoubleFunction<? super T> mapper)
      Transforms the elements of the specified collection to double values using the specified ToDoubleFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the collection
      Parameters:
      mapper - the function used to map the elements to double values
      a - the collection of values to be mapped
      Returns:
      a new double array containing the mapped values, or an empty double collection if the input array is null or empty
      See Also:
    • mapToDouble

      public static <T> double[] mapToDouble(Collection<? extends T> c, int fromIndex, int toIndex, ToDoubleFunction<? super T> mapper) throws IndexOutOfBoundsException
      Transforms the elements within the specified range in the input collection to double values using the specified ToDoubleFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the collection
      Parameters:
      fromIndex - the starting index (inclusive) of the range to be mapped
      toIndex - the ending index (exclusive) of the range to be mapped
      mapper - the function used to map the elements to double values
      a - the collection of values to be mapped
      Returns:
      a new double array containing the mapped values, or an empty double array if the input collection/range is null or empty
      Throws:
      IndexOutOfBoundsException - the specified range is out of the collection's bounds.
      See Also:
    • mapToDouble

      @Beta public static double[] mapToDouble(int[] a, IntToDoubleFunction mapper)
      Transforms the int values in the specified array to double values using the specified IntToDoubleFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Parameters:
      a - the array of int values to be mapped
      mapper - the function used to map the int values to double values
      Returns:
      a new double array containing the mapped values, or an empty double array if the input array is null or empty
    • mapToDouble

      @Beta public static double[] mapToDouble(long[] a, LongToDoubleFunction mapper)
      Transforms the long values in the specified array to double values using the specified IntToDoubleFunction.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Parameters:
      a - the array of long values to be mapped
      mapper - the function used to map the long values to double values
      Returns:
      a new double array containing the mapped values, or an empty double array if the input array is null or empty
    • map

      public static <T, R> List<R> map(T[] a, Function<? super T,? extends R> mapper)
      Transforms the elements in the specified array from type: {code T} to type: R by applying the specified Function<T, R> to each element.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - The type of the elements in the input array.
      R - The type of the elements are mapped to.
      Parameters:
      a - The input array to be transformed.
      mapper - The function to apply to each element in the input array.
      Returns:
      A list containing the transformed elements, or an empty list if the input array is null or empty.
    • map

      public static <T, R, C extends Collection<R>> C map(T[] a, Function<? super T,? extends R> mapper, IntFunction<? extends C> supplier)
      Transforms the elements in the specified array from type: {code T} to type: R by applying the specified Function<T, R> to each element.
      The returned collection is created by the specified supplier.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - The type of the elements in the input array.
      R - The type of the elements are mapped to.
      Parameters:
      a - The input array to be transformed.
      mapper - The function to apply to each element in the input array.
      supplier - The supplier used to create the returned collection.
      Returns:
      A collection containing the transformed elements, or an empty collection created by the supplier if the input array/range is null or empty.
    • map

      public static <T, R> List<R> map(T[] a, int fromIndex, int toIndex, Function<? super T,? extends R> mapper) throws IndexOutOfBoundsException
      Transforms the elements within the specified range in the input array from type: {code T} to type: R by applying the specified Function<T, R> to each element.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - The type of the elements in the input array.
      R - The type of the elements are mapped to.
      Parameters:
      a - The input array to be transformed.
      fromIndex - the starting index (inclusive) of the range to be mapped
      toIndex - the ending index (exclusive) of the range to be mapped
      mapper - The function to apply to each element in the input array.
      Returns:
      A list containing the transformed elements, or an empty list if the input array is null or empty.
      Throws:
      IndexOutOfBoundsException - If the specified range is out of the array's bounds.
    • map

      public static <T, R, C extends Collection<R>> C map(T[] a, int fromIndex, int toIndex, Function<? super T,? extends R> mapper, IntFunction<? extends C> supplier) throws IndexOutOfBoundsException
      Transforms the elements within the specified range in the input array from type: {code T} to type: R by applying the specified Function<T, R> to each element.
      The returned collection is created by the specified supplier.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - The type of the elements in the input array.
      R - The type of the elements are mapped to.
      Parameters:
      a - The input array to be transformed.
      fromIndex - the starting index (inclusive) of the range to be mapped
      toIndex - the ending index (exclusive) of the range to be mapped
      mapper - The function to apply to each element in the input array.
      supplier - The supplier used to create the returned collection.
      Returns:
      A collection containing the transformed elements, or an empty collection created by the supplier if the input array/range is null or empty.
      Throws:
      IndexOutOfBoundsException - If the specified range is out of the array's bounds.
    • map

      public static <T, R> List<R> map(Collection<? extends T> c, int fromIndex, int toIndex, Function<? super T,? extends R> mapper) throws IndexOutOfBoundsException
      Transforms the elements within the specified range in the input collection from type: {code T} to type: R by applying the specified Function<T, R> to each element.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - The type of the elements in the input collection.
      R - The type of the elements are mapped to.
      Parameters:
      c - The input collection to be transformed.
      fromIndex - the starting index (inclusive) of the range to be mapped
      toIndex - the ending index (exclusive) of the range to be mapped
      mapper - The function to apply to each element in the input collection.
      Returns:
      A list containing the transformed elements, or an empty list if the input collection is null or empty.
      Throws:
      IndexOutOfBoundsException - If the specified range is out of the collection's bounds.
    • map

      public static <T, R, C extends Collection<R>> C map(Collection<? extends T> c, int fromIndex, int toIndex, Function<? super T,? extends R> mapper, IntFunction<? extends C> supplier) throws IndexOutOfBoundsException
      Transforms the elements within the specified range in the input collection from type: {code T} to type: R by applying the specified Function<T, R> to each element.
      The returned collection is created by the specified supplier.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - The type of the elements in the input collection.
      R - The type of the elements are mapped to.
      C - The type of the returned collection
      Parameters:
      c - The input collection to be transformed.
      fromIndex - the starting index (inclusive) of the range to be mapped
      toIndex - the ending index (exclusive) of the range to be mapped
      mapper - The function to apply to each element in the input collection.
      supplier - The supplier used to create the returned collection.
      Returns:
      A collection containing the transformed elements, or an empty collection created by the supplier if the input collection/range is null or empty.
      Throws:
      IndexOutOfBoundsException - If the specified range is out of the collection's bounds.
    • map

      public static <T, R> List<R> map(Iterable<? extends T> c, Function<? super T,? extends R> mapper)
      Transforms the elements in the specified iterable from type: {code T} to type: R by applying the specified Function<T, R> to each element.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - The type of the elements in the iterable.
      R - The type of the elements are mapped to.
      Parameters:
      c - The input iterable to be transformed.
      mapper - The function to apply to each element in the input iterable.
      Returns:
      A list containing the transformed elements, or an empty list if the input iterable is null or empty.
    • map

      public static <T, R, C extends Collection<R>> C map(Iterable<? extends T> c, Function<? super T,? extends R> mapper, IntFunction<? extends C> supplier)
      Transforms the elements in the specified iterable from type: {code T} to type: R by applying the specified Function<T, R> to each element.
      The returned collection is created by the specified supplier.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - The type of the elements in the iterable.
      R - The type of the elements are mapped to.
      C - The type of the returned collection
      Parameters:
      c - The input iterable to be transformed.
      mapper - The function to apply to each element in the input iterable.
      supplier - The supplier used to create the returned collection.
      Returns:
      A collection containing the transformed elements, or an empty collection created by the supplier if the input iterable is null or empty.
    • map

      public static <T, R> List<R> map(Iterator<? extends T> iter, Function<? super T,? extends R> mapper)
      Transforms the elements in the specified iterator from type: {code T} to type: R by applying the specified Function<T, R> to each element.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - The type of the elements in the iterator.
      R - The type of the elements are mapped to.
      Parameters:
      iter - The input iterator to be transformed.
      mapper - The function to apply to each element in the input iterator.
      Returns:
      A list containing the transformed elements, or an empty list if the input iterator is null or empty.
      See Also:
    • map

      public static <T, R, C extends Collection<R>> C map(Iterator<? extends T> iter, Function<? super T,? extends R> mapper, IntFunction<? extends C> supplier)
      Transforms the elements in the specified iterator from type: {code T} to type: R by applying the specified Function<T, R> to each element.
      The returned collection is created by the specified supplier.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - The type of the elements in the iterator.
      R - The type of the elements are mapped to.
      C - The type of the returned collection
      Parameters:
      iter - The input iterable to be transformed.
      mapper - The function to apply to each element in the input iterator.
      supplier - The supplier used to create the returned collection.
      Returns:
      A collection containing the transformed elements, or an empty collection created by the supplier if the input iterator is null or empty.
      See Also:
    • flatMap

      public static <T, R> List<R> flatMap(T[] a, Function<? super T,? extends Collection<? extends R>> mapper)
      Transforms the elements in the specified array from type: {code T} to a collection of type: R by applying the specified Function<T, Collection<R>> to each element.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - The type of the elements in the input array.
      R - The type of the elements are mapped to.
      Parameters:
      a - The input array to be transformed.
      mapper - The function to transform each element in the input array to a collection.
      Returns:
      A list containing the transformed elements, or an empty list if the input array is null or empty.
    • flatMap

      public static <T, R, C extends Collection<R>> C flatMap(T[] a, Function<? super T,? extends Collection<? extends R>> mapper, IntFunction<? extends C> supplier)
      Transforms the elements in the specified array from type: {code T} to a collection of type: R by applying the specified Function<T, Collection<R>> to each element.
      The returned collection is created by the specified supplier.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - The type of the elements in the input array.
      R - The type of the elements are mapped to.
      Parameters:
      a - The input array to be transformed.
      mapper - The function to transform each element in the input array to a collection.
      supplier - The supplier used to create the returned collection.
      Returns:
      A collection containing the transformed elements, or an empty collection created by the supplier if the input array/range is null or empty.
    • flatMap

      public static <T, R> List<R> flatMap(T[] a, int fromIndex, int toIndex, Function<? super T,? extends Collection<? extends R>> mapper)
      Transforms the elements within the specified range in the input array from type: {code T} to a collection of type: R by applying the specified Function<T, Collection<R>> to each element.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - The type of the elements in the input array.
      R - The type of the elements are mapped to.
      Parameters:
      a - The input array to be transformed.
      fromIndex - the starting index (inclusive) of the range to be mapped
      toIndex - the ending index (exclusive) of the range to be mapped
      mapper - The function to transform each element in the input array to a collection.
      Returns:
      A list containing the transformed elements, or an empty list if the input array is null or empty.
      Throws:
      IndexOutOfBoundsException - If the specified range is out of the array's bounds.
    • flatMap

      public static <T, R, C extends Collection<R>> C flatMap(T[] a, int fromIndex, int toIndex, Function<? super T,? extends Collection<? extends R>> mapper, IntFunction<? extends C> supplier) throws IndexOutOfBoundsException
      Transforms the elements within the specified range in the input array from type: {code T} to a collection of type: R by applying the specified Function<T, Collection<R>> to each element.
      The returned collection is created by the specified supplier.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - The type of the elements in the input array.
      R - The type of the elements are mapped to.
      C - The type of the returned collection
      Parameters:
      a - The input array to be transformed.
      fromIndex - the starting index (inclusive) of the range to be mapped
      toIndex - the ending index (exclusive) of the range to be mapped
      mapper - The function to transform each element in the input array to a collection.
      supplier - The supplier used to create the returned collection.
      Returns:
      A collection containing the transformed elements, or an empty collection created by the supplier if the input array/range is null or empty.
      Throws:
      IndexOutOfBoundsException - If the specified range is out of the array's bounds.
    • flatMap

      public static <T, R> List<R> flatMap(Collection<? extends T> c, int fromIndex, int toIndex, Function<? super T,? extends Collection<? extends R>> mapper) throws IndexOutOfBoundsException
      Transforms the elements within the specified range in the input collection from type: {code T} to a collection of type: R by applying the specified Function<T, Collection<R>> to each element.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - The type of the elements in the input collection.
      R - The type of the elements are mapped to.
      Parameters:
      c - The input collection to be transformed.
      fromIndex - the starting index (inclusive) of the range to be mapped
      toIndex - the ending index (exclusive) of the range to be mapped
      mapper - The function to transform each element in the input collection to a collection.
      Returns:
      A list containing the transformed elements, or an empty list if the input collection is null or empty.
      Throws:
      IndexOutOfBoundsException - If the specified range is out of the collection's bounds.
    • flatMap

      public static <T, R, C extends Collection<R>> C flatMap(Collection<? extends T> c, int fromIndex, int toIndex, Function<? super T,? extends Collection<? extends R>> mapper, IntFunction<? extends C> supplier) throws IndexOutOfBoundsException
      Transforms the elements within the specified range in the input collection from type: {code T} to a collection of type: R by applying the specified Function<T, Collection<R>> to each element.
      The returned collection is created by the specified supplier.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - The type of the elements in the input collection.
      R - The type of the elements are mapped to.
      C - The type of the returned collection
      Parameters:
      c - The input collection to be transformed.
      fromIndex - the starting index (inclusive) of the range to be mapped
      toIndex - the ending index (exclusive) of the range to be mapped
      mapper - The function to transform each element in the input collection to a collection.
      supplier - The supplier used to create the returned collection.
      Returns:
      A collection containing the transformed elements, or an empty collection created by the supplier if the input collection/range is null or empty.
      Throws:
      IndexOutOfBoundsException - If the specified range is out of the collection's bounds.
    • flatMap

      public static <T, R> List<R> flatMap(Iterable<? extends T> c, Function<? super T,? extends Collection<? extends R>> mapper)
      Transforms the elements in the specified iterable from type: {code T} to a collection of type: R by applying the specified Function<T, Collection<R>> to each element.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - The type of the elements in the iterable.
      R - The type of the elements are mapped to.
      Parameters:
      c - The input iterable to be transformed.
      mapper - The function to transform each element in the input iterable to a collection.
      Returns:
      A list containing the transformed elements, or an empty list if the input iterable is null or empty.
    • flatMap

      public static <T, R, C extends Collection<R>> C flatMap(Iterable<? extends T> c, Function<? super T,? extends Collection<? extends R>> mapper, IntFunction<? extends C> supplier) throws IndexOutOfBoundsException
      Transforms the elements in the specified iterable from type: {code T} to a collection of type: R by applying the specified Function<T, Collection<R>> to each element.
      The returned collection is created by the specified supplier.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - The type of the elements in the iterable.
      R - The type of the elements are mapped to.
      C - The type of the returned collection
      Parameters:
      c - The input iterable to be transformed.
      mapper - The function to transform each element in the input iterable to a collection.
      supplier - The supplier used to create the returned collection.
      Returns:
      A collection containing the transformed elements, or an empty collection created by the supplier if the input iterable is null or empty.
      Throws:
      IndexOutOfBoundsException
    • flatMap

      public static <T, R> List<R> flatMap(Iterator<? extends T> iter, Function<? super T,? extends Collection<? extends R>> mapper)
      Transforms the elements in the specified iterator from type: {code T} to a collection of type: R by applying the specified Function<T, Collection<R>> to each element.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - The type of the elements in the iterator.
      R - The type of the elements are mapped to.
      Parameters:
      iter - The input iterator to be transformed.
      mapper - The function to transform each element in the input iterator to a collection.
      Returns:
      A list containing the transformed elements, or an empty list if the input iterator is null or empty.
      See Also:
    • flatMap

      public static <T, R, C extends Collection<R>> C flatMap(Iterator<? extends T> iter, Function<? super T,? extends Collection<? extends R>> mapper, IntFunction<? extends C> supplier) throws IndexOutOfBoundsException
      Transforms the elements in the specified iterator from type: {code T} to a collection of type: R by applying the specified Function<T, Collection<R>> to each element.
      The returned collection is created by the specified supplier.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - The type of the elements in the iterator.
      R - The type of the elements are mapped to.
      C - The type of the returned collection
      Parameters:
      iter - The input iterator to be transformed.
      mapper - The function to transform each element in the input iterator to a collection.
      supplier - The supplier used to create the returned collection.
      Returns:
      A collection containing the transformed elements, or an empty collection created by the supplier if the input iterator is null or empty.
      Throws:
      IndexOutOfBoundsException
      See Also:
    • flatMap

      public static <T, U, R> List<R> flatMap(T[] a, Function<? super T,? extends Collection<? extends U>> mapper, Function<? super U,? extends Collection<? extends R>> mapper2)
      Transforms the elements in the specified array from type T to a collection of type R by applying the specified Function<T, Collection<U>> to each element, and then applying the specified Function<U, Collection<R>> to each element in the intermediate collections.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the input array
      U - the intermediate type of the elements after the first mapping
      R - the type of the elements in the resulting list
      Parameters:
      a - the input array to be transformed
      mapper - the function to transform each element in the input array to a collection of type U
      mapper2 - the function to transform each element in the intermediate collections to a collection of type R
      Returns:
      a list containing the transformed elements, or an empty list if the input array is null or empty
    • flatMap

      public static <T, U, R, C extends Collection<R>> C flatMap(T[] a, Function<? super T,? extends Collection<? extends U>> mapper, Function<? super U,? extends Collection<? extends R>> mapper2, IntFunction<? extends C> supplier)
      Transforms the elements in the specified array from type T to a collection of type R by applying the specified Function<T, Collection<U>> to each element, and then applying the specified Function<U, Collection<R>> to each element in the intermediate collections.
      The returned collection is created by the specified supplier.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the input array
      U - the intermediate type of the elements after the first mapping
      R - the type of the elements in the resulting list
      C - the type of the returned collection
      Parameters:
      a - the input array to be transformed
      mapper - the function to transform each element in the input array to a collection of type U
      mapper2 - the function to transform each element in the intermediate collections to a collection of type R
      supplier - the supplier used to create the returned collection
      Returns:
      a collection containing the transformed elements, or an empty collection created by the supplier if the input array is null or empty
    • flatMap

      public static <T, U, R> List<R> flatMap(Iterable<? extends T> c, Function<? super T,? extends Collection<? extends U>> mapper, Function<? super U,? extends Collection<? extends R>> mapper2)
      Transforms the elements in the specified iterable from type T to a collection of type R by applying the specified Function<T, Collection<U>> to each element, and then applying the specified Function<U, Collection<R>> to each element in the intermediate collections.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the input iterable
      U - the intermediate type of the elements after the first mapping
      R - the type of the elements in the resulting list
      Parameters:
      c - the input iterable to be transformed
      mapper - the function to transform each element in the input iterable to a collection of type U
      mapper2 - the function to transform each element in the intermediate collections to a collection of type R
      Returns:
      a list containing the transformed elements, or an empty list if the input iterable is null or empty
    • flatMap

      public static <T, U, R, C extends Collection<R>> C flatMap(Iterable<? extends T> c, Function<? super T,? extends Collection<? extends U>> mapper, Function<? super U,? extends Collection<? extends R>> mapper2, IntFunction<? extends C> supplier)
      Transforms the elements in the specified iterable from type T to a collection of type R by applying the specified Function<T, Collection<U>> to each element, and then applying the specified Function<U, Collection<R>> to each element in the intermediate collections.
      The returned collection is created by the specified supplier.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the input iterable
      U - the intermediate type of the elements after the first mapping
      R - the type of the elements in the resulting list
      C - the type of the returned collection
      Parameters:
      c - the input iterable to be transformed
      mapper - the function to transform each element in the input iterable to a collection of type U
      mapper2 - the function to transform each element in the intermediate collections to a collection of type R
      supplier - the supplier used to create the returned collection
      Returns:
      a collection containing the transformed elements, or an empty collection created by the supplier if the input iterable is null or empty
    • flatMap

      public static <T, U, R> List<R> flatMap(Iterator<? extends T> iter, Function<? super T,? extends Collection<? extends U>> mapper, Function<? super U,? extends Collection<? extends R>> mapper2)
      Transforms the elements in the specified iterator from type T to a collection of type R by applying the specified Function<T, Collection<U>> to each element, and then applying the specified Function<U, Collection<R>> to each element in the intermediate collections.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the input iterator
      U - the intermediate type of the elements after the first mapping
      R - the type of the elements in the resulting list
      Parameters:
      iter - the input iterator to be transformed
      mapper - the function to transform each element in the input iterator to a collection of type U
      mapper2 - the function to transform each element in the intermediate collections to a collection of type R
      Returns:
      a list containing the transformed elements, or an empty list if the input iterator is null or empty
    • flatMap

      public static <T, U, R, C extends Collection<R>> C flatMap(Iterator<? extends T> iter, Function<? super T,? extends Collection<? extends U>> mapper, Function<? super U,? extends Collection<? extends R>> mapper2, IntFunction<? extends C> supplier)
      Transforms the elements in the specified iterator from type T to a collection of type R by applying the specified Function<T, Collection<U>> to each element, and then applying the specified Function<U, Collection<R>> to each element in the intermediate collections.
      The returned collection is created by the specified supplier.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of the elements in the input iterator
      U - the intermediate type of the elements after the first mapping
      R - the type of the elements in the resulting list
      C - the type of the returned collection
      Parameters:
      iter - the input iterator to be transformed
      mapper - the function to transform each element in the input iterator to a collection of type U
      mapper2 - the function to transform each element in the intermediate collections to a collection of type R
      supplier - the supplier used to create the returned collection
      Returns:
      a collection containing the transformed elements, or an empty collection created by the supplier if the input iterator is null or empty.
    • takeWhile

      public static <T> List<T> takeWhile(T[] a, Predicate<? super T> filter)
      Returns a list containing the elements of the input array until the provided predicate returns false.
      Type Parameters:
      T - the type of elements in the input array
      Parameters:
      a - the array to be processed
      filter - the predicate used to test elements
      Returns:
      a list of elements from the input array starting from the first element until the predicate returns false. An empty list is returned if the input array is null or empty.
    • takeWhile

      public static <T> List<T> takeWhile(Iterable<? extends T> c, Predicate<? super T> filter)
      Returns a list containing the elements of the input iterable until the provided predicate returns false.
      Type Parameters:
      T - the type of elements in the input iterable
      Parameters:
      c - the iterable to be processed
      filter - the predicate used to test elements
      Returns:
      a list of elements from the input iterable starting from the first element until the predicate returns false. An empty list is returned if the input iterable is null or empty.
    • takeWhile

      public static <T> List<T> takeWhile(Iterator<? extends T> iter, Predicate<? super T> filter)
      Returns a list containing the elements of the input iterator until the provided predicate returns false.
      Type Parameters:
      T - the type of elements in the input iterator
      Parameters:
      iter - the iterator to be processed
      filter - the predicate used to test elements
      Returns:
      a list of elements from the input iterator starting from the first element until the predicate returns false. An empty list is returned if the input iterator is null or empty.
    • takeWhileInclusive

      public static <T> List<T> takeWhileInclusive(T[] a, Predicate<? super T> filter)
      Returns a list containing the elements of the input array until the provided predicate returns false, including the element that fails the predicate.
      Type Parameters:
      T - the type of elements in the input array
      Parameters:
      a - the array to process.
      filter - the predicate to apply to elements of the array.
      Returns:
      a list of elements from the input array starting from the first element until the predicate returns false, including the element that fails the predicate. An empty list is returned if the input array is null or empty.
    • takeWhileInclusive

      public static <T> List<T> takeWhileInclusive(Iterable<? extends T> c, Predicate<? super T> filter)
      Returns a list containing the elements of the input iterable until the provided predicate returns false, including the element that fails the predicate.
      Type Parameters:
      T - the type of elements in the input iterable
      Parameters:
      c - the iterable to process.
      filter - the predicate to apply to elements of the iterable.
      Returns:
      a list of elements from the input iterable starting from the first element until the predicate returns false, including the element that fails the predicate. An empty list is returned if the input iterable is null or empty.
    • takeWhileInclusive

      public static <T> List<T> takeWhileInclusive(Iterator<? extends T> iter, Predicate<? super T> filter)
      Returns a list containing the elements of the input iterator until the provided predicate returns false, including the element that fails the predicate.
      Type Parameters:
      T - the type of elements in the input iterator
      Parameters:
      iter - the iterator to process.
      filter - the predicate to apply to elements of the iterator.
      Returns:
      a list of elements from the input iterator starting from the first element until the predicate returns false, including the element that fails the predicate. An empty list is returned if the input iterator is null or empty.
    • dropWhile

      public static <T> List<T> dropWhile(T[] a, Predicate<? super T> filter)
      Returns a list containing the elements of the input array after dropping the elements that satisfy the provided predicate.
      Type Parameters:
      T - the type of elements in the input array
      Parameters:
      a - the array to process.
      filter - the predicate to apply to elements of the array.
      Returns:
      a list of elements from the input array starting from the first element that fails the predicate. An empty list is returned if the input array is null or empty.
    • dropWhile

      public static <T> List<T> dropWhile(Iterable<? extends T> c, Predicate<? super T> filter)
      Returns a list containing the elements of the input iterable after dropping the elements that satisfy the provided predicate.
      Type Parameters:
      T - the type of elements in the input iterable
      Parameters:
      c - the iterable to process.
      filter - the predicate to apply to elements of the iterable.
      Returns:
      a list of elements from the input iterable starting from the first element that fails the predicate. An empty list is returned if the input iterable is null or empty.
    • dropWhile

      public static <T> List<T> dropWhile(Iterator<? extends T> iter, Predicate<? super T> filter)
      Returns a list containing the elements of the input iterator after dropping the elements that satisfy the provided predicate.
      Type Parameters:
      T - the type of elements in the input iterator
      Parameters:
      iter - the iterator to process.
      filter - the predicate to apply to elements of the iterator.
      Returns:
      a list of elements from the input iterator starting from the first element that fails the predicate. An empty list is returned if the input iterator is null or empty.
    • skipUntil

      public static <T> List<T> skipUntil(T[] a, Predicate<? super T> filter)
      Returns a list containing the elements of the input array starting from the first element that satisfies the provided predicate.
      Type Parameters:
      T - the type of elements in the input array
      Parameters:
      a - the array to process.
      filter - the predicate to apply to elements of the array.
      Returns:
      a list of elements from the input array starting from the first element that satisfies the predicate. An empty list if the input array is null or empty.
    • skipUntil

      public static <T> List<T> skipUntil(Iterable<? extends T> c, Predicate<? super T> filter)
      Returns a list containing the elements of the input iterable starting from the first element that satisfies the provided predicate.
      Type Parameters:
      T - the type of elements in the input iterable
      Parameters:
      c - the iterable to process.
      filter - the predicate to apply to elements of the iterable.
      Returns:
      a list of elements from the input iterable starting from the first element that satisfies the predicate. An empty list is returned if the input iterable is null or empty.
    • skipUntil

      public static <T> List<T> skipUntil(Iterator<? extends T> iter, Predicate<? super T> filter)
      Returns a list containing the elements of the input iterator starting from the first element that satisfies the provided predicate.
      Type Parameters:
      T - the type of elements in the input iterable
      Parameters:
      iter - the iterator to process.
      filter - the predicate to apply to elements of the iterator.
      Returns:
      a list of elements from the input iterator starting from the first element that satisfies the predicate. An empty list is returned if the input iterator is null or empty.
    • mapAndFilter

      @Beta public static <T, R> List<R> mapAndFilter(Iterable<? extends T> c, Function<? super T,? extends R> mapper, Predicate<? super R> filter)
      Maps and filters the elements in the given iterable.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of elements in the input iterable
      R - the type of elements in the resulting list
      Parameters:
      c - the input iterable
      mapper - the function to apply to each element
      filter - the predicate to apply to each mapped element
      Returns:
      a list of elements that have been mapped and filtered. An empty list is returned if the input iterable is null or empty.
      See Also:
    • mapAndFilter

      @Beta public static <T, R, C extends Collection<R>> C mapAndFilter(Iterable<? extends T> c, Function<? super T,? extends R> mapper, Predicate<? super R> filter, IntFunction<? extends C> supplier)
      Maps and filters the elements in the given iterable.
      The returned collection is created by the specified supplier.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of elements in the input iterable
      R - the type of elements in the resulting collection
      C - the type of the resulting collection
      Parameters:
      c - the input iterable
      mapper - the function to apply to each element
      filter - the predicate to apply to each mapped element
      supplier - the supplier used to create the returned collection
      Returns:
      a collection of elements that have been mapped and filtered. An empty collection created by the specified supplier is returned if the input iterable is null or empty.
      See Also:
    • filterAndMap

      @Beta public static <T, R> List<R> filterAndMap(Iterable<? extends T> c, Predicate<? super T> filter, Function<? super T,? extends R> mapper)
      Filters and maps the elements in the given iterable.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of elements in the input iterable
      R - the type of elements in the resulting list
      Parameters:
      c - the input iterable
      filter - the predicate to apply to each element
      mapper - the function to apply to each filtered element
      Returns:
      a list of elements that have been filtered and mapped. An empty list is returned if the input iterable is null or empty.
      See Also:
    • filterAndMap

      @Beta public static <T, R, C extends Collection<R>> C filterAndMap(Iterable<? extends T> c, Predicate<? super T> filter, Function<? super T,? extends R> mapper, IntFunction<C> supplier)
      Filters and maps the elements in the given iterable.
      The returned collection is created by the specified supplier.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of elements in the input iterable
      R - the type of elements in the resulting collection
      C - the type of the resulting collection
      Parameters:
      c - the input iterable
      filter - the predicate to apply to each element
      mapper - the function to apply to each filtered element
      supplier - the supplier used to create the returned collection
      Returns:
      a collection of elements that have been filtered and mapped. An empty collection created by the specified supplier is returned if the input iterable is null or empty.
      See Also:
    • flatMapAndFilter

      @Beta public static <T, R> List<R> flatMapAndFilter(Iterable<? extends T> c, Function<? super T,? extends Collection<? extends R>> mapper, Predicate<? super R> filter)
      Flat-maps and filters the elements in the given iterable.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of elements in the input iterable
      R - the type of elements in the resulting collection
      Parameters:
      c - the input iterable
      mapper - the function to apply to each element, which returns a collection of results
      filter - the predicate to apply to each element of the resulting collections
      Returns:
      a list of elements that have been flat-mapped and filtered. An empty list is returned if the input iterable is null or empty.
      See Also:
    • flatMapAndFilter

      @Beta public static <T, R, C extends Collection<R>> C flatMapAndFilter(Iterable<? extends T> c, Function<? super T,? extends Collection<? extends R>> mapper, Predicate<? super R> filter, IntFunction<? extends C> supplier)
      Flat-maps and filters the elements in the given iterable.
      The returned collection is created by the specified supplier.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of elements in the input iterable
      R - the type of elements in the resulting collection
      C - the type of the resulting collection
      Parameters:
      c - the input iterable
      mapper - the function to apply to each element, which returns a collection of results
      filter - the predicate to apply to each element of the resulting collections
      supplier - the supplier used to create the returned collection
      Returns:
      a collection of elements that have been flat-mapped and filtered. An empty collection created by the specified supplier is returned if the input iterable is null or empty.
      See Also:
    • filterAndFlatMap

      @Beta public static <T, R> List<R> filterAndFlatMap(Iterable<? extends T> c, Predicate<? super T> filter, Function<? super T,? extends Collection<? extends R>> mapper)
      Filters and flat-maps the elements in the given iterable.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of elements in the input iterable
      R - the type of elements in the resulting list
      Parameters:
      c - the input iterable
      filter - the predicate to apply to each element to determine if it should be included
      mapper - the function to apply to each filtered element, which returns a collection of results
      Returns:
      a list of elements that have been filtered and flat-mapped. An empty list is returned if the input iterable is null or empty.
      See Also:
    • filterAndFlatMap

      @Beta public static <T, R, C extends Collection<R>> C filterAndFlatMap(Iterable<? extends T> c, Predicate<? super T> filter, Function<? super T,? extends Collection<? extends R>> mapper, IntFunction<C> supplier)
      Filters and flat-maps the elements in the given iterable.
      The returned collection is created by the specified supplier.

      Mostly it's designed for one-step operation. java.util.stream.Stream is preferred for multiple phases operation.

      Type Parameters:
      T - the type of elements in the input iterable
      R - the type of elements in the resulting collection
      C - the type of the resulting collection
      Parameters:
      c - the input iterable
      filter - the predicate to apply to each element to determine if it should be included
      mapper - the function to apply to each filtered element, which returns a collection of results
      supplier - the supplier used to create the returned collection
      Returns:
      a collection of elements that have been filtered and flat-mapped. An empty collection created by the specified supplier is returned if the input iterable is null or empty.
      See Also:
    • distinct

      public static boolean[] distinct(boolean[] a)
      Returns a new array containing only the distinct elements from the specified array.
      Parameters:
      a - the input array of boolean values
      Returns:
      a new array containing only the distinct elements from the specified array. An empty array is returned if the specified array is null or empty.
    • distinct

      public static boolean[] distinct(boolean[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a new array containing only the distinct elements from the specified range in the input array.
      Parameters:
      a - the input array of boolean values
      fromIndex - the starting index (inclusive) of the range
      toIndex - the ending index (exclusive) of the range
      Returns:
      a new array containing only the distinct elements from the specified range in the input array. An empty array is returned if the specified array/range is null or empty.
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
    • distinct

      public static char[] distinct(char[] a)
      Returns a new array containing only the distinct elements from the specified array.
      Parameters:
      a - the input array of char values
      Returns:
      a new array containing only the distinct elements from the specified array. An empty array is returned if the specified array is null or empty.
    • distinct

      public static char[] distinct(char[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a new array containing only the distinct elements from the specified range in the input array.
      Parameters:
      a - the input array of char values
      fromIndex - the starting index (inclusive) of the range
      toIndex - the ending index (exclusive) of the range
      Returns:
      a new array containing only the distinct elements from the specified range in the input array. An empty array is returned if the specified array/range is null or empty.
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
    • distinct

      public static byte[] distinct(byte[] a)
      Returns a new array containing only the distinct elements from the specified array.
      Parameters:
      a - the input array of byte values
      Returns:
      a new array containing only the distinct elements from the specified array. An empty array is returned if the specified array is null or empty.
    • distinct

      public static byte[] distinct(byte[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a new array containing only the distinct elements from the specified range in the input array.
      Parameters:
      a - the input array of byte values
      fromIndex - the starting index (inclusive) of the range
      toIndex - the ending index (exclusive) of the range
      Returns:
      a new array containing only the distinct elements from the specified range in the input array. An empty array is returned if the specified array/range is null or empty.
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
    • distinct

      public static short[] distinct(short[] a)
      Returns a new array containing only the distinct elements from the specified array.
      Parameters:
      a - the input array of short values
      Returns:
      a new array containing only the distinct elements from the specified array. An empty array is returned if the specified array is null or empty.
    • distinct

      public static short[] distinct(short[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a new array containing only the distinct elements from the specified range in the input array.
      Parameters:
      a - the input array of short values
      fromIndex - the starting index (inclusive) of the range
      toIndex - the ending index (exclusive) of the range
      Returns:
      a new array containing only the distinct elements from the specified range in the input array. An empty array is returned if the specified array/range is null or empty.
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
    • distinct

      public static int[] distinct(int[] a)
      Returns a new array containing only the distinct elements from the specified array.
      Parameters:
      a - the input array of int values
      Returns:
      a new array containing only the distinct elements from the specified array. An empty array is returned if the specified array is null or empty.
    • distinct

      public static int[] distinct(int[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a new array containing only the distinct elements from the specified range in the input array.
      Parameters:
      a - the input array of int values
      fromIndex - the starting index (inclusive) of the range
      toIndex - the ending index (exclusive) of the range
      Returns:
      a new array containing only the distinct elements from the specified range in the input array. An empty array is returned if the specified array/range is null or empty.
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
    • distinct

      public static long[] distinct(long[] a)
      Returns a new array containing only the distinct elements from the specified array.
      Parameters:
      a - the input array of long values
      Returns:
      a new array containing only the distinct elements from the specified array. An empty array is returned if the specified array is null or empty.
    • distinct

      public static long[] distinct(long[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a new array containing only the distinct elements from the specified range in the input array.
      Parameters:
      a - the input array of long values
      fromIndex - the starting index (inclusive) of the range
      toIndex - the ending index (exclusive) of the range
      Returns:
      a new array containing only the distinct elements from the specified range in the input array. An empty array is returned if the specified array/range is null or empty.
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
    • distinct

      public static float[] distinct(float[] a)
      Returns a new array containing only the distinct elements from the specified array.
      Parameters:
      a - the input array of float values
      Returns:
      a new array containing only the distinct elements from the specified array. An empty array is returned if the specified array is null or empty.
    • distinct

      public static float[] distinct(float[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a new array containing only the distinct elements from the specified range in the input array.
      Parameters:
      a - the input array of float values
      fromIndex - the starting index (inclusive) of the range
      toIndex - the ending index (exclusive) of the range
      Returns:
      a new array containing only the distinct elements from the specified range in the input array. An empty array is returned if the specified array/range is null or empty.
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
    • distinct

      public static double[] distinct(double[] a)
      Returns a new array containing only the distinct elements from the specified array.
      Parameters:
      a - the input array of double values
      Returns:
      a new array containing only the distinct elements from the specified array. An empty array is returned if the specified array is null or empty.
    • distinct

      public static double[] distinct(double[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a new array containing only the distinct elements from the specified range in the input array.
      Parameters:
      a - the input array of double values
      fromIndex - the starting index (inclusive) of the range
      toIndex - the ending index (exclusive) of the range
      Returns:
      a new array containing only the distinct elements from the specified range in the input array. An empty array is returned if the specified array/range is null or empty.
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
    • distinct

      public static <T> List<T> distinct(T[] a)
      Returns a new list containing only the distinct elements from the specified array.
      Type Parameters:
      T - the type of elements in the input array
      Parameters:
      a - the input array
      Returns:
      a new list containing only the distinct elements from the specified array. An empty list is returned if the input array is null or empty.
      See Also:
    • distinct

      public static <T> List<T> distinct(T[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a new list containing only the distinct elements from the specified range in the input array.
      Type Parameters:
      T - the type of elements in the input array
      Parameters:
      a - the input array
      fromIndex - the starting index (inclusive) of the range
      toIndex - the ending index (exclusive) of the range
      Returns:
      a new list containing only the distinct elements from the specified range in the input array. An empty list is returned if the input array/range is null or empty.
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
      See Also:
    • distinct

      public static <T> List<T> distinct(Collection<? extends T> c, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a new list containing only the distinct elements from the specified range in the input collection.
      Type Parameters:
      T - the type of elements in the input collection
      Parameters:
      c - the input collection
      fromIndex - the starting index (inclusive) of the range
      toIndex - the ending index (exclusive) of the range
      Returns:
      a new list containing only the distinct elements from the specified range in the input collection. An empty list is returned if the input collection/range is null or empty.
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
      See Also:
      • invalid reference
        #removeDuplicates(Collection, int, int, boolean)
    • distinct

      public static <T> List<T> distinct(Iterable<? extends T> c)
      Returns a new list containing only the distinct elements from the specified iterable.
      Type Parameters:
      T - the type of elements in the input iterable
      Parameters:
      c - the input iterable
      Returns:
      a new list containing only the distinct elements from the specified iterable. An empty list is returned if the input iterable is null or empty
      See Also:
    • distinct

      public static <T> List<T> distinct(Iterator<? extends T> iter)
      Returns a new list containing only the distinct elements from the specified iterator.
      Type Parameters:
      T - the type of elements in the input iterator
      Parameters:
      iter - the input iterator
      Returns:
      a new list containing only the distinct elements from the specified iterator. An empty list is returned if the input iterator is null or empty
      See Also:
    • distinctBy

      public static <T> List<T> distinctBy(T[] a, Function<? super T,?> keyExtractor)
      Returns a new list containing only the distinct elements from the specified array, where distinctness is determined by the keys extracted by the specified Function<T, K>.
      Type Parameters:
      T - the type of elements in the input array
      Parameters:
      a - the input array
      keyExtractor - the function to extract the key for distinct comparison
      Returns:
      a new list containing only the distinct elements from the input array. An empty list is returned if the input array is null or empty
    • distinctBy

      public static <T> List<T> distinctBy(T[] a, int fromIndex, int toIndex, Function<? super T,?> keyExtractor) throws IndexOutOfBoundsException
      Returns a new list containing only the distinct elements from the specified range in the input array, where distinctness is determined by the keys extracted by the specified Function<T, K>.
      Type Parameters:
      T - the type of elements in the input array
      Parameters:
      a - the input array
      fromIndex - the starting index (inclusive) of the range
      toIndex - the ending index (exclusive) of the range
      keyExtractor - the function to extract the key for distinct comparison
      Returns:
      a new list containing only the distinct elements from the specified range in the input array. An empty list is returned if the input array/range is null or empty
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
    • distinctBy

      public static <T, C extends Collection<T>> C distinctBy(T[] a, Function<? super T,?> keyExtractor, Supplier<C> supplier)
      Returns a new collection containing only the distinct elements from the specified array, where distinctness is determined by the keys extracted by the specified Function<T, K>. The returned collection is created by the specified supplier.
      Type Parameters:
      T - the type of elements in the input array
      Parameters:
      a - the input array
      keyExtractor - the function to extract the key for distinct comparison
      supplier - the supplier used to create the returned collection
      Returns:
      a new collection containing only the distinct elements from the input array. An empty collection is returned if the input array is null or empty
    • distinctBy

      public static <T> List<T> distinctBy(Collection<? extends T> c, int fromIndex, int toIndex, Function<? super T,?> keyExtractor) throws IndexOutOfBoundsException
      Returns a new list containing only the distinct elements from the specified range in the input collection, where distinctness is determined by the keys extracted by the specified Function<T, K>.
      Type Parameters:
      T - the type of elements in the input collection
      Parameters:
      c - the input collection
      fromIndex - the starting index (inclusive) of the range
      toIndex - the ending index (exclusive) of the range
      keyExtractor - the function to extract the key for distinct comparison
      Returns:
      a new list containing only the distinct elements from the specified range in the input collection. An empty list is returned if the input collection/range is null or empty
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
    • distinctBy

      public static <T> List<T> distinctBy(Iterable<? extends T> c, Function<? super T,?> keyExtractor)
      Returns a new list containing only the distinct elements from the specified iterable, where distinctness is determined by the keys extracted by the specified Function<T, K>.
      Type Parameters:
      T - the type of elements in the input iterable
      Parameters:
      c - the input iterable
      keyExtractor - the function to extract the key for distinct comparison
      Returns:
      a new list containing only the distinct elements from the specified iterable. An empty list is returned if the input iterable is null or empty
    • distinctBy

      public static <T, C extends Collection<T>> C distinctBy(Iterable<? extends T> c, Function<? super T,?> keyExtractor, Supplier<C> supplier)
      Returns a new collection containing only the distinct elements from the specified iterable, where distinctness is determined by the keys extracted by the specified Function<T, K>. The returned collection is created by the specified supplier.
      Type Parameters:
      T - the type of elements in the input iterable
      C - the type of the resulting collection
      Parameters:
      c - the input iterable
      keyExtractor - the function to extract the key for distinct comparison
      supplier - the supplier used to create the returned collection
      Returns:
      a new collection containing only the distinct elements from the input iterable. An empty collection is returned if the input iterable is null or empty
    • distinctBy

      public static <T> List<T> distinctBy(Iterator<? extends T> iter, Function<? super T,?> keyExtractor)
      Returns a new list containing only the distinct elements from the specified iterator, where distinctness is determined by the keys extracted by the specified Function<T, K>.
      Type Parameters:
      T - the type of elements in the input iterator
      Parameters:
      iter - the input iterator
      keyExtractor - the function to extract the key for distinct comparison
      Returns:
      a new list containing only the distinct elements from the specified iterator. An empty list is returned if the input iterator is null or empty
      See Also:
    • distinctBy

      public static <T, C extends Collection<T>> C distinctBy(Iterator<? extends T> iter, Function<? super T,?> keyExtractor, Supplier<C> supplier)
      Returns a new collection containing only the distinct elements from the specified iterator, where distinctness is determined by the keys extracted by the specified Function<T, K>. The returned collection is created by the specified supplier.
      Type Parameters:
      T - the type of elements in the input iterator
      C - the type of the resulting collection
      Parameters:
      iter - the input iterator
      keyExtractor - the function to extract the key for distinct comparison
      supplier - the supplier used to create the returned collection
      Returns:
      a new collection containing only the distinct elements from the input iterator. An empty collection is returned if the input iterator is null or empty
    • allMatch

      public static <T> boolean allMatch(T[] a, Predicate<? super T> filter)
      Checks if all elements in the input array match the given predicate.
      Type Parameters:
      T - the type of elements in the input array
      Parameters:
      a - the input array
      filter - the predicate to apply to each element
      Returns:
      true if all elements match the predicate or the input array is null or empty, false otherwise
    • allMatch

      public static <T> boolean allMatch(Iterable<? extends T> c, Predicate<? super T> filter)
      Checks if all elements in the input iterable match the given predicate.
      Type Parameters:
      T - the type of elements in the input iterable
      Parameters:
      c - the input iterable
      filter - the predicate to apply to each element
      Returns:
      true if all elements match the predicate or the input iterable is null or empty, false otherwise
    • allMatch

      public static <T> boolean allMatch(Iterator<? extends T> iter, Predicate<? super T> filter)
      Checks if all elements in the input iterator match the given predicate.
      Type Parameters:
      T - the type of elements in the input iterator
      Parameters:
      iter - the input iterator
      filter - the predicate to apply to each element
      Returns:
      true if all elements match the predicate or the input iterator is null or empty, false otherwise
    • anyMatch

      public static <T> boolean anyMatch(T[] a, Predicate<? super T> filter)
      Checks if any element in the input array matches the given predicate.
      Type Parameters:
      T - the type of elements in the input array
      Parameters:
      a - the input array
      filter - the predicate to apply to each element
      Returns:
      true if any element matches the predicate, false otherwise
    • anyMatch

      public static <T> boolean anyMatch(Iterable<? extends T> c, Predicate<? super T> filter)
      Checks if any element in the input iterable matches the given predicate.
      Type Parameters:
      T - the type of elements in the input iterable
      Parameters:
      c - the input iterable
      filter - the predicate to apply to each element
      Returns:
      true if any element matches the predicate, false otherwise
    • anyMatch

      public static <T> boolean anyMatch(Iterator<? extends T> iter, Predicate<? super T> filter)
      Checks if any element in the input iterator matches the given predicate.
      Type Parameters:
      T - the type of elements in the input iterator
      Parameters:
      iter - the input iterator
      filter - the predicate to apply to each element
      Returns:
      true if any element matches the predicate, false otherwise
    • noneMatch

      public static <T> boolean noneMatch(T[] a, Predicate<? super T> filter)
      Checks if none of the elements in the input array match the given predicate.
      Type Parameters:
      T - the type of elements in the input array
      Parameters:
      a - the input array
      filter - the predicate to apply to each element
      Returns:
      true if none of the elements match the predicate or the input array is null or empty, false otherwise
    • noneMatch

      public static <T> boolean noneMatch(Iterable<? extends T> c, Predicate<? super T> filter)
      Checks if none of the elements in the input iterable match the given predicate.
      Type Parameters:
      T - the type of elements in the input iterable
      Parameters:
      c - the input iterable
      filter - the predicate to apply to each element
      Returns:
      true if none of the elements match the predicate or the input iterable is null or empty, false otherwise
    • noneMatch

      public static <T> boolean noneMatch(Iterator<? extends T> iter, Predicate<? super T> filter)
      Checks if none of the elements in the input iterator match the given predicate.
      Type Parameters:
      T - the type of elements in the input iterator
      Parameters:
      iter - the input iterator
      filter - the predicate to apply to each element
      Returns:
      true if none of the elements match the predicate or the input iterator is null or empty, false otherwise
    • nMatch

      public static <T> boolean nMatch(T[] a, int atLeast, int atMost, Predicate<? super T> filter)
      Checks if the number of elements in the input array that match the given predicate is between the specified minimum and maximum values (inclusive).
      Type Parameters:
      T - the type of elements in the input array
      Parameters:
      a - the input array
      filter - the predicate to apply to each element
      Returns:
      true if the number of matching elements is between atLeast and atMost (inclusive), false otherwise
      Throws:
      IllegalArgumentException - if atLeast or atMost is negative, or if atLeast is greater than atMost
    • nMatch

      public static <T> boolean nMatch(Iterable<? extends T> c, int atLeast, int atMost, Predicate<? super T> filter)
      Checks if the number of elements in the input iterable that match the given predicate is between the specified minimum and maximum values (inclusive).
      Type Parameters:
      T - the type of elements in the input iterable
      Parameters:
      c - the input iterable
      filter - the predicate to apply to each element
      Returns:
      true if the number of matching elements is between atLeast and atMost (inclusive), false otherwise
      Throws:
      IllegalArgumentException - if atLeast or atMost is negative, or if atLeast is greater than atMost
    • nMatch

      public static <T> boolean nMatch(Iterator<? extends T> iter, int atLeast, int atMost, Predicate<? super T> filter)
      Checks if the number of elements in the input iterator that match the given predicate is between the specified minimum and maximum values (inclusive).
      Type Parameters:
      T - the type of elements in the input iterator
      Parameters:
      iter - the input iterator
      filter - the predicate to apply to each element
      Returns:
      true if the number of matching elements is between atLeast and atMost (inclusive), false otherwise
      Throws:
      IllegalArgumentException - if atLeast or atMost is negative, or if atLeast is greater than atMost
    • allTrue

      public static boolean allTrue(boolean[] a)
      Checks if all elements in the input boolean array are true.
      Parameters:
      a - the input boolean array
      Returns:
      true if all elements are true or the input array is null or empty, false otherwise
    • allFalse

      public static boolean allFalse(boolean[] a)
      Checks if all elements in the input boolean array are false.
      Parameters:
      a - the input boolean array
      Returns:
      true if all elements are false or the input array is null or empty, false otherwise
    • anyTrue

      public static boolean anyTrue(boolean[] a)
      Checks if any element in the input boolean array is true.
      Parameters:
      a - the input boolean array
      Returns:
      true if any element is true, false otherwise
    • anyFalse

      public static boolean anyFalse(boolean[] a)
      Checks if any element in the input boolean array is false.
      Parameters:
      a - the input boolean array
      Returns:
      true if any element is false, false otherwise
    • count

      public static int count(boolean[] a, BooleanPredicate filter)
      Counts the number of elements in the input boolean array that match the given predicate.
      Parameters:
      a - the input boolean array
      filter - the predicate to test if an element should be counted or not.
      Returns:
      the number of elements that match the predicate. 0 is returned if the input array is null or empty
    • count

      public static int count(boolean[] a, int fromIndex, int toIndex, BooleanPredicate filter) throws IndexOutOfBoundsException
      Counts the number of elements within the specified range in the input boolean array that match the given predicate.
      Parameters:
      a - the input boolean array
      fromIndex - the starting index (inclusive) of the range
      toIndex - the ending index (exclusive) of the range
      filter - the predicate to test if an element should be counted or not.
      Returns:
      the number of elements within the specified range in the input boolean array that match the given predicate. 0 is returned if the input array/range is null or empty
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
    • count

      public static int count(char[] a, CharPredicate filter)
      Counts the number of elements in the input byte array that match the given predicate.
      Parameters:
      a - the input byte array
      filter - the predicate to test if an element should be counted or not.
      Returns:
      the number of elements that match the predicate. 0 is returned if the input array is null or empty
    • count

      public static int count(char[] a, int fromIndex, int toIndex, CharPredicate filter) throws IndexOutOfBoundsException
      Counts the number of elements within the specified range in the input byte array that match the given predicate.
      Parameters:
      a - the input byte array
      fromIndex - the starting index (inclusive) of the range
      toIndex - the ending index (exclusive) of the range
      filter - the predicate to test if an element should be counted or not.
      Returns:
      the number of elements within the specified range in the input byte array that match the given predicate. 0 is returned if the input array/range is null or empty
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
    • count

      public static int count(byte[] a, BytePredicate filter)
      Counts the number of elements in the input byte array that match the given predicate.
      Parameters:
      a - the input byte array
      filter - the predicate to test if an element should be counted or not.
      Returns:
      the number of elements that match the predicate. 0 is returned if the input array is null or empty
    • count

      public static int count(byte[] a, int fromIndex, int toIndex, BytePredicate filter) throws IndexOutOfBoundsException
      Counts the number of elements within the specified range in the input byte array that match the given predicate.
      Parameters:
      a - the input byte array
      fromIndex - the starting index (inclusive) of the range
      toIndex - the ending index (exclusive) of the range
      filter - the predicate to test if an element should be counted or not.
      Returns:
      the number of elements within the specified range in the input byte array that match the given predicate. 0 is returned if the input array/range is null or empty
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
    • count

      public static int count(short[] a, ShortPredicate filter)
      Counts the number of elements in the input short array that match the given predicate.
      Parameters:
      a - the input short array
      filter - the predicate to test if an element should be counted or not.
      Returns:
      the number of elements that match the predicate. 0 is returned if the input array is null or empty
    • count

      public static int count(short[] a, int fromIndex, int toIndex, ShortPredicate filter) throws IndexOutOfBoundsException
      Counts the number of elements within the specified range in the input short array that match the given predicate.
      Parameters:
      a - the input short array
      fromIndex - the starting index (inclusive) of the range
      toIndex - the ending index (exclusive) of the range
      filter - the predicate to test if an element should be counted or not.
      Returns:
      the number of elements within the specified range in the input short array that match the given predicate. 0 is returned if the input array/range is null or empty
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
    • count

      public static int count(int[] a, IntPredicate filter)
      Counts the number of elements in the input int array that match the given predicate.
      Parameters:
      a - the input int array
      filter - the predicate to test if an element should be counted or not.
      Returns:
      the number of elements that match the predicate. 0 is returned if the input array is null or empty
    • count

      public static int count(int[] a, int fromIndex, int toIndex, IntPredicate filter) throws IndexOutOfBoundsException
      Counts the number of elements within the specified range in the input int array that match the given predicate.
      Parameters:
      a - the input int array
      fromIndex - the starting index (inclusive) of the range
      toIndex - the ending index (exclusive) of the range
      filter - the predicate to test if an element should be counted or not.
      Returns:
      the number of elements within the specified range in the input int array that match the given predicate. 0 is returned if the input array/range is null or empty
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
    • count

      public static int count(long[] a, LongPredicate filter)
      Counts the number of elements in the input long array that match the given predicate.
      Parameters:
      a - the input long array
      filter - the predicate to test if an element should be counted or not.
      Returns:
      the number of elements that match the predicate. 0 is returned if the input array is null or empty
    • count

      public static int count(long[] a, int fromIndex, int toIndex, LongPredicate filter) throws IndexOutOfBoundsException
      Counts the number of elements within the specified range in the input long array that match the given predicate.
      Parameters:
      a - the input long array
      fromIndex - the starting index (inclusive) of the range
      toIndex - the ending index (exclusive) of the range
      filter - the predicate to test if an element should be counted or not.
      Returns:
      the number of elements within the specified range in the input long array that match the given predicate. 0 is returned if the input array/range is null or empty
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
    • count

      public static int count(float[] a, FloatPredicate filter)
      Counts the number of elements in the input float array that match the given predicate.
      Parameters:
      a - the input float array
      filter - the predicate to test if an element should be counted or not.
      Returns:
      the number of elements that match the predicate. 0 is returned if the input array is null or empty
    • count

      public static int count(float[] a, int fromIndex, int toIndex, FloatPredicate filter) throws IndexOutOfBoundsException
      Counts the number of elements within the specified range in the input float array that match the given predicate.
      Parameters:
      a - the input float array
      fromIndex - the starting index (inclusive) of the range
      toIndex - the ending index (exclusive) of the range
      filter - the predicate to test if an element should be counted or not.
      Returns:
      the number of elements within the specified range in the input float array that match the given predicate. 0 is returned if the input array/range is null or empty
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
    • count

      public static int count(double[] a, DoublePredicate filter) throws IndexOutOfBoundsException
      Counts the number of elements in the input double array that match the given predicate.
      Parameters:
      a - the input double array
      filter - the predicate to test if an element should be counted or not.
      Returns:
      the number of elements that match the predicate. 0 is returned if the input array is null or empty
      Throws:
      IndexOutOfBoundsException
    • count

      public static int count(double[] a, int fromIndex, int toIndex, DoublePredicate filter) throws IndexOutOfBoundsException
      Counts the number of elements within the specified range in the input double array that match the given predicate.
      Parameters:
      a - the input double array
      fromIndex - the starting index (inclusive) of the range
      toIndex - the ending index (exclusive) of the range
      filter - the predicate to test if an element should be counted or not.
      Returns:
      the number of elements within the specified range in the input double array that match the given predicate. 0 is returned if the input array/range is null or empty
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
    • count

      public static <T> int count(T[] a, Predicate<? super T> filter) throws IndexOutOfBoundsException
      Counts the number of elements in the input array that match the given predicate.
      Type Parameters:
      T - the type of elements in the input array
      Parameters:
      a - the input array
      filter - the predicate to test if an element should be counted or not.
      Returns:
      the number of elements that match the predicate. 0 is returned if the input array is null or empty
      Throws:
      IndexOutOfBoundsException
    • count

      public static <T> int count(T[] a, int fromIndex, int toIndex, Predicate<? super T> filter) throws IndexOutOfBoundsException
      Counts the number of elements within the specified range in the input array that match the given predicate.
      Type Parameters:
      T - the type of elements in the input array
      Parameters:
      a - the input array
      fromIndex - the starting index (inclusive) of the range
      toIndex - the ending index (exclusive) of the range
      filter - the predicate to test if an element should be counted or not.
      Returns:
      the number of elements within the specified range in the input array that match the given predicate. 0 is returned if the input array/range is null or empty
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
    • count

      public static <T> int count(Collection<? extends T> c, int fromIndex, int toIndex, Predicate<? super T> filter) throws IndexOutOfBoundsException
      Counts the number of elements within the specified range in the input collection that match the given predicate.
      Type Parameters:
      T - the type of elements in the input collection
      Parameters:
      c - the input collection
      fromIndex - the starting index (inclusive) of the range
      toIndex - the ending index (exclusive) of the range
      filter - the predicate to test if an element should be counted or not.
      Returns:
      the number of elements within the specified range in the input collection that match the given predicate. 0 is returned if the input collection/range is null or empty
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
    • count

      public static <T> int count(Iterable<? extends T> c, Predicate<? super T> filter)
      Counts the number of elements in the input iterable that match the given predicate.
      Type Parameters:
      T - the type of elements in the input iterable
      Parameters:
      c - the input iterable
      filter - the predicate to test if an element should be counted or not.
      Returns:
      the number of elements that match the predicate. 0 is returned if the input iterable is null or empty
    • count

      public static int count(Iterator<?> iter) throws ArithmeticException
      Counts the number of elements in the input iterator.
      Type Parameters:
      T - the type of elements in the input iterator
      Parameters:
      iter - the input iterator
      Returns:
      the number of elements in the input iterator. 0 is returned if the input iterator is null or empty
      Throws:
      ArithmeticException - if the total count overflows an int
      See Also:
    • count

      public static <T> int count(Iterator<? extends T> iter, Predicate<? super T> filter) throws ArithmeticException
      Counts the number of elements in the input iterator that match the given predicate.
      Type Parameters:
      T - the type of elements in the input iterator
      Parameters:
      iter - the input iterator
      filter - the predicate to test if an element should be counted or not.
      Returns:
      the number of elements that match the predicate. 0 is returned if the input iterator is null or empty
      Throws:
      ArithmeticException - if the total count overflows an int
      See Also:
    • merge

      public static <T> List<T> merge(T[] a, T[] b, BiFunction<? super T,? super T,MergeResult> nextSelector)
      Merges two the input arrays into a list based where the order of the elements is determined by the given selector function.
      Type Parameters:
      T - the type of elements in the arrays
      Parameters:
      a - the first array to merge
      b - the second array to merge
      nextSelector - a function that determines the next element to add to the result list
      Returns:
      a list containing the merged elements from both arrays. An empty list is returned if both arrays are null or empty.
      See Also:
    • merge

      public static <T> List<T> merge(Iterable<? extends T> a, Iterable<? extends T> b, BiFunction<? super T,? super T,MergeResult> nextSelector)
      Merges two the input iterables into a list based where the order of the elements is determined by the given selector function.
      Type Parameters:
      T - the type of elements in the iterables
      Parameters:
      a - the first iterable to merge
      b - the second iterable to merge
      nextSelector - a function that determines the next element to add to the result list
      Returns:
      a list containing the merged elements from both iterables. An empty list is returned if both iterables are null or empty.
      See Also:
    • merge

      public static <T> List<T> merge(Collection<? extends Iterable<? extends T>> c, BiFunction<? super T,? super T,MergeResult> nextSelector)
      Merges multiple iterables into a list based where the order of the elements is determined by the given selector function.
      Type Parameters:
      T - the type of elements in the iterables
      Parameters:
      c - the collection of iterable to merge
      nextSelector - a function that determines the next element to add to the result list
      Returns:
      a list containing the merged elements from all iterables. An empty list is returned if all iterables are null or empty.
      See Also:
    • merge

      public static <T, C extends Collection<T>> C merge(Collection<? extends Iterable<? extends T>> c, BiFunction<? super T,? super T,MergeResult> nextSelector, IntFunction<? extends C> supplier)
      Merges multiple iterables into a list based where the order of the elements is determined by the given selector function. The returned collection is created by the specified supplier.
      Type Parameters:
      T - the type of elements in the iterables
      C - the type of the resulting collection
      Parameters:
      c - the collection of iterable to merge
      nextSelector - a function that determines the next element to add to the result collection
      supplier - the supplier used to create the returned collection
      Returns:
      a collection containing the merged elements from all iterables. An empty collection created by the specified supplier is returned if all iterables are null or empty.
      See Also:
    • zip

      public static <A, B, R> List<R> zip(A[] a, B[] b, BiFunction<? super A,? super B,? extends R> zipFunction)
      Zips two arrays into a single list using the provided zip function. The size of the resulting list is equal to the size of the shorter input array.
      Type Parameters:
      A - the type of elements in the first array
      B - the type of elements in the second array
      R - the type of elements in the resulting list
      Parameters:
      a - the first array to zip
      b - the second array to zip
      zipFunction - a function that combines elements from the two arrays. An empty list is returned if the one of input arrays is null or empty.
      Returns:
      a list containing the zipped elements
    • zip

      public static <A, B, R> List<R> zip(Iterable<A> a, Iterable<B> b, BiFunction<? super A,? super B,? extends R> zipFunction)
      Zips two iterables into a single list using the provided zip function. The size of the resulting list is equal to the size of the shorter input iterable.
      Type Parameters:
      A - the type of elements in the first iterable
      B - the type of elements in the second iterable
      R - the type of elements in the resulting list
      Parameters:
      a - the first iterable to zip
      b - the second iterable to zip
      zipFunction - a function that combines elements from the two iterables. An empty list is returned if the one of input iterables is null or empty.
      Returns:
      a list containing the zipped elements
    • zip

      public static <A, B, C, R> List<R> zip(A[] a, B[] b, C[] c, TriFunction<? super A,? super B,? super C,? extends R> zipFunction)
      Zips three arrays into a single list using the provided zip function. The size of the resulting list is equal to the size of the shortest input array.
      Type Parameters:
      A - the type of elements in the first array
      B - the type of elements in the second array
      C - the type of elements in the third array
      R - the type of elements in the resulting list
      Parameters:
      a - the first array to zip
      b - the second array to zip
      c - the third array to zip
      zipFunction - a function that combines elements from the three arrays. An empty list is returned if the one of input arrays is null or empty.
      Returns:
      a list containing the zipped elements
    • zip

      public static <A, B, C, R> List<R> zip(Iterable<A> a, Iterable<B> b, Iterable<C> c, TriFunction<? super A,? super B,? super C,? extends R> zipFunction)
      Zips three iterables into a single list using the provided zip function. The size of the resulting list is equal to the size of the shortest input iterables.
      Type Parameters:
      A - the type of elements in the first iterable
      B - the type of elements in the second iterable
      C - the type of elements in the third iterable
      R - the type of elements in the resulting list
      Parameters:
      a - the first iterable to zip
      b - the second iterable to zip
      c - the third iterable to zip
      zipFunction - a function that combines elements from the three iterables. An empty list is returned if the one of input iterables is null or empty.
      Returns:
      a list containing the zipped elements
    • zip

      public static <A, B, R> List<R> zip(A[] a, B[] b, A valueForNoneA, B valueForNoneB, BiFunction<? super A,? super B,? extends R> zipFunction)
      Zips two arrays into a single list using the provided zip function. If one array is shorter, the provided default values are used for the remaining elements. The size of the resulting list is equal to the size of the longer input array.
      Type Parameters:
      A - the type of elements in the first array
      B - the type of elements in the second array
      R - the type of elements in the resulting list
      Parameters:
      a - the first array to zip
      b - the second array to zip
      valueForNoneA - the default value to use if the first array is shorter
      valueForNoneB - the default value to use if the second array is shorter
      zipFunction - a function that combines elements from the two arrays
      Returns:
      a list containing the zipped elements
    • zip

      public static <A, B, R> List<R> zip(Iterable<A> a, Iterable<B> b, A valueForNoneA, B valueForNoneB, BiFunction<? super A,? super B,? extends R> zipFunction)
      Zips two iterables into a single list using the provided zip function. If one iterable is shorter, the provided default values are used for the remaining elements. The size of the resulting list is equal to the size of the longer input iterable.
      Type Parameters:
      A - the type of elements in the first iterable
      B - the type of elements in the second iterable
      R - the type of elements in the resulting list
      Parameters:
      a - the first iterable to zip
      b - the second iterable to zip
      valueForNoneA - the default value to use if the first iterable is shorter
      valueForNoneB - the default value to use if the second iterable is shorter
      zipFunction - a function that combines elements from the two iterables
      Returns:
      a list containing the zipped elements
    • zip

      public static <A, B, C, R> List<R> zip(A[] a, B[] b, C[] c, A valueForNoneA, B valueForNoneB, C valueForNoneC, TriFunction<? super A,? super B,? super C,? extends R> zipFunction)
      Zips three arrays into a single list using the provided zip function. If one array is shorter, the provided default values are used for the remaining elements. The size of the resulting list is equal to the size of the longest input array.
      Type Parameters:
      A - the type of elements in the first array
      B - the type of elements in the second array
      C - the type of elements in the third array
      R - the type of elements in the resulting list
      Parameters:
      a - the first array to zip
      b - the second array to zip
      c - the third array to zip
      valueForNoneA - the default value to use if the first array is shorter
      valueForNoneB - the default value to use if the second array is shorter
      valueForNoneC - the default value to use if the third array is shorter
      zipFunction - a function that combines elements from the three arrays
      Returns:
      a list containing the zipped elements
    • zip

      public static <A, B, C, R> List<R> zip(Iterable<A> a, Iterable<B> b, Iterable<C> c, A valueForNoneA, B valueForNoneB, C valueForNoneC, TriFunction<? super A,? super B,? super C,? extends R> zipFunction)
      Zips three iterables into a single list using the provided zip function. If one iterable is shorter, the provided default values are used for the remaining elements. The size of the resulting list is equal to the size of the longest input iterable.
      Type Parameters:
      A - the type of elements in the first iterable
      B - the type of elements in the second iterable
      C - the type of elements in the third iterable
      R - the type of elements in the resulting list
      Parameters:
      a - the first iterable to zip
      b - the second iterable to zip
      c - the third iterable to zip
      valueForNoneA - the default value to use if the first iterable is shorter
      valueForNoneB - the default value to use if the second iterable is shorter
      valueForNoneC - the default value to use if the third iterable is shorter
      zipFunction - a function that combines elements from the three iterables
      Returns:
      a list containing the zipped elements
    • zip

      public static <A, B, R> R[] zip(A[] a, B[] b, BiFunction<? super A,? super B,? extends R> zipFunction, Class<R> targetElementType) throws IllegalArgumentException
      Zips two arrays into a single array using the provided zip function. The size of the resulting array is equal to the size of the shorter input array.
      Type Parameters:
      A - the type of elements in the first array
      B - the type of elements in the second array
      R - the type of elements in the resulting array
      Parameters:
      a - the first array to zip
      b - the second array to zip
      zipFunction - a function that combines elements from the two arrays. An empty list is returned if the one of input arrays is null or empty.
      targetElementType - the class of the resulting array's element type
      Returns:
      a list containing the zipped elements
      Throws:
      IllegalArgumentException - if the targetElementType is null
    • zip

      public static <A, B, R> R[] zip(A[] a, B[] b, A valueForNoneA, B valueForNoneB, BiFunction<? super A,? super B,? extends R> zipFunction, Class<R> targetElementType) throws IllegalArgumentException
      Zips two arrays into a single array using the provided zip function. If one array is shorter, the provided default values are used for the remaining elements. The size of the resulting array is equal to the size of the longer input array.
      Type Parameters:
      A - the type of elements in the first array
      B - the type of elements in the second array
      R - the type of elements in the resulting array
      Parameters:
      a - the first array to zip
      b - the second array to zip
      valueForNoneA - the default value to use if the first array is shorter
      valueForNoneB - the default value to use if the second array is shorter
      zipFunction - a function that combines elements from the two arrays
      targetElementType - the class of the resulting array's element type
      Returns:
      a list containing the zipped elements
      Throws:
      IllegalArgumentException - if the targetElementType is null
    • zip

      public static <A, B, C, R> R[] zip(A[] a, B[] b, C[] c, TriFunction<? super A,? super B,? super C,? extends R> zipFunction, Class<R> targetElementType) throws IllegalArgumentException
      Zips three arrays into a single array using the provided zip function. The size of the resulting array is equal to the size of the shortest input array.
      Type Parameters:
      A - the type of elements in the first array
      B - the type of elements in the second array
      C - the type of elements in the third array
      R - the type of elements in the resulting array
      Parameters:
      a - the first array to zip
      b - the second array to zip
      c - the third array to zip
      zipFunction - a function that combines elements from the three arrays. An empty list is returned if the one of input arrays is null or empty.
      targetElementType - the class of the resulting array's element type
      Returns:
      a list containing the zipped elements
      Throws:
      IllegalArgumentException - if the targetElementType is null
    • zip

      public static <A, B, C, R> R[] zip(A[] a, B[] b, C[] c, A valueForNoneA, B valueForNoneB, C valueForNoneC, TriFunction<? super A,? super B,? super C,? extends R> zipFunction, Class<R> targetElementType) throws IllegalArgumentException
      Zips three arrays into a single array using the provided zip function. If one array is shorter, the provided default values are used for the remaining elements. The size of the resulting array is equal to the size of the longest input array.
      Type Parameters:
      A - the type of elements in the first array
      B - the type of elements in the second array
      C - the type of elements in the third array
      R - the type of elements in the resulting array
      Parameters:
      a - the first array to zip
      b - the second array to zip
      c - the third array to zip
      valueForNoneA - the default value to use if the first array is shorter
      valueForNoneB - the default value to use if the second array is shorter
      valueForNoneC - the default value to use if the third array is shorter
      zipFunction - a function that combines elements from the three arrays
      targetElementType - the class of the resulting array's element type
      Returns:
      a list containing the zipped elements
      Throws:
      IllegalArgumentException - if the targetElementType is null
    • unzip

      public static <T, A, B> Pair<List<A>,List<B>> unzip(Iterable<? extends T> c, BiConsumer<? super T,Pair<A,B>> unzip)
      Unzips an iterable into two separate lists using the provided unzip function.
      Type Parameters:
      T - the type of elements in the input iterable
      A - the type of elements in the first output list
      B - the type of elements in the second output list
      Parameters:
      c - the input iterable to unzip
      unzip - a function that takes an element from the input iterable and a pair, and populates the pair with the unzipped values
      Returns:
      a pair of lists, where the first list contains the first elements and the second list contains the second elements
    • unzip

      public static <T, A, B, LC extends Collection<A>, RC extends Collection<B>> Pair<LC,RC> unzip(Iterable<? extends T> c, BiConsumer<? super T,Pair<A,B>> unzip, IntFunction<? extends Collection<?>> supplier)
      Unzips an iterable into two separate collections using the provided unzip function.
      Type Parameters:
      T - the type of elements in the input iterable
      A - the type of elements in the first output collection
      B - the type of elements in the second output collection
      LC - the type of the first output collection
      RC - the type of the second output collection
      Parameters:
      c - the input iterable to unzip
      unzip - a function that takes an element from the input iterable and a pair, and populates the pair with the unzipped values
      supplier - a function that provides new instances of the output collections
      Returns:
      a pair of lists, where the first collection contains the first elements and the second collection contains the second elements
    • unzipp

      @Deprecated public static <T, A, B, C> Triple<List<A>,List<B>,List<C>> unzipp(Iterable<? extends T> c, BiConsumer<? super T,Triple<A,B,C>> unzip)
      Unzips an iterable into three separate lists using the provided unzip function.
      Type Parameters:
      T - the type of elements in the input iterable
      A - the type of elements in the first output list
      B - the type of elements in the second output list
      C - the type of elements in the third output list
      Parameters:
      c - the input iterable to unzip
      unzip - a function that takes an element from the input iterable and a triple, and populates the triple with the unzipped values
      Returns:
      a triple of lists, where the first list contains the first elements, the second list contains the second elements and the third list contains the third elements
      See Also:
    • unzipp

      @Deprecated public static <T, A, B, C, LC extends Collection<A>, MC extends Collection<B>, RC extends Collection<C>> Triple<LC,MC,RC> unzipp(Iterable<? extends T> c, BiConsumer<? super T,Triple<A,B,C>> unzip, IntFunction<? extends Collection<?>> supplier)
      Deprecated.
      replaced by
      invalid reference
      TriIterator#unzip(Iterable, BiConsumer, Supplier)
      Unzips an iterable into three separate collections using the provided unzip function.
      Type Parameters:
      T - the type of elements in the input iterable
      A - the type of elements in the first output collection
      B - the type of elements in the second output collection
      C - the type of elements in the third output collection
      LC - the type of the first output collection
      MC - the type of the second output collection
      RC - the type of the third output collection
      Parameters:
      c - the input iterable to unzip
      unzip - a function that takes an element from the input iterable and a triple, and populates the triple with the unzipped values
      supplier - a function that provides new instances of the output collections
      Returns:
      a triple of collections, where the first collection contains the first elements, the second collection contains the second elements and the third collection contains the third elements
      See Also:
    • groupBy

      @Beta public static <T, K> Map<K,List<T>> groupBy(T[] a, Function<? super T,? extends K> keyExtractor)
      Groups the elements in the given array by the key extracted by the specified Function<T, K>.
      Type Parameters:
      T - the type of elements in the array
      K - the type of keys
      Parameters:
      a - the array to group
      keyExtractor - a function to extract the key for grouping
      Returns:
      a map where the keys are extracted from the elements and the values are lists of elements that share the same key. An empty map is returned if the input array is null or empty.
    • groupBy

      @Beta public static <T, K, M extends Map<K, List<T>>> M groupBy(T[] a, Function<? super T,? extends K> keyExtractor, Supplier<M> mapSupplier)
      Groups the elements in the given array by the key extracted by the specified Function<T, K>.
      Type Parameters:
      T - the type of elements in the array
      K - the type of keys
      M - the type of returned map
      Parameters:
      a - the array to group
      keyExtractor - a function to extract the key for grouping
      mapSupplier - a function to create the returned map
      Returns:
      a map where the keys are extracted from the elements and the values are lists of elements that share the same key. An empty map is returned if the input array is null or empty.
    • groupBy

      @Beta public static <T, K> Map<K,List<T>> groupBy(T[] a, int fromIndex, int toIndex, Function<? super T,? extends K> keyExtractor)
      Groups the elements within specified range in the given array by the key extracted by the specified Function<T, K>.
      Type Parameters:
      T - the type of elements in the array
      K - the type of keys
      Parameters:
      a - the array to group
      fromIndex - the index of the first element (inclusive) to be grouped
      toIndex - the index of the last element (exclusive) to be grouped
      keyExtractor - a function to extract the key for grouping
      Returns:
      a map where the keys are extracted from the elements within specified range and the values are lists of elements that share the same key. An empty map is returned if the input array is null or empty.
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
    • groupBy

      @Beta public static <T, K, M extends Map<K, List<T>>> M groupBy(T[] a, int fromIndex, int toIndex, Function<? super T,? extends K> keyExtractor, Supplier<M> mapSupplier) throws IndexOutOfBoundsException
      Groups the elements within specified range in the given array by the key extracted by the specified Function<T, K>.
      Type Parameters:
      T - the type of elements in the array
      K - the type of keys
      M - the type of returned map
      Parameters:
      a - the array to group
      fromIndex - the index of the first element (inclusive) to be grouped
      toIndex - the index of the last element (exclusive) to be grouped
      keyExtractor - a function to extract the key for grouping
      mapSupplier - a function to create the returned map
      Returns:
      a map where the keys are extracted from the elements within specified range and the values are lists of elements that share the same key. An empty map is returned if the input array is null or empty.
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
    • groupBy

      @Beta public static <T, K> Map<K,List<T>> groupBy(Collection<? extends T> c, int fromIndex, int toIndex, Function<? super T,? extends K> keyExtractor)
      Groups the elements within specified range in the given collection by the key extracted by the specified Function<T, K>.
      Type Parameters:
      T - the type of elements in the collection
      K - the type of keys
      Parameters:
      fromIndex - the index of the first element (inclusive) to be grouped
      toIndex - the index of the last element (exclusive) to be grouped
      keyExtractor - a function to extract the key for grouping
      a - the collection to group
      Returns:
      a map where the keys are extracted from the elements within specified range and the values are lists of elements that share the same key. An empty map is returned if the input collection is null or empty.
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
    • groupBy

      @Beta public static <T, K, M extends Map<K, List<T>>> M groupBy(Collection<? extends T> c, int fromIndex, int toIndex, Function<? super T,? extends K> keyExtractor, Supplier<M> mapSupplier) throws IndexOutOfBoundsException
      Groups the elements within specified range in the given collection by the key extracted by the specified Function<T, K>.
      Type Parameters:
      T - the type of elements in the collection
      K - the type of keys
      M - the type of returned map
      Parameters:
      fromIndex - the index of the first element (inclusive) to be grouped
      toIndex - the index of the last element (exclusive) to be grouped
      keyExtractor - a function to extract the key for grouping
      mapSupplier - a function to create the returned map
      a - the collection to group
      Returns:
      a map where the keys are extracted from the elements within specified range and the values are lists of elements that share the same key. An empty map is returned if the collection array is null or empty.
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
    • groupBy

      @Beta public static <T, K> Map<K,List<T>> groupBy(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor)
      Groups the elements in the given iterable by the key extracted by the specified Function<T, K>.
      Type Parameters:
      T - the type of elements in the iterable
      K - the type of keys
      Parameters:
      c - the iterable to group
      keyExtractor - a function to extract the key for grouping
      Returns:
      a map where the keys are extracted from the elements and the values are lists of elements that share the same key. An empty map is returned if the input iterable is null or empty.
    • groupBy

      @Beta public static <T, K, M extends Map<K, List<T>>> M groupBy(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor, Supplier<M> mapSupplier)
      Groups the elements in the given iterable by the key extracted by the specified Function<T, K>.
      Type Parameters:
      T - the type of elements in the iterable
      K - the type of keys
      M - the type of returned map
      Parameters:
      c - the iterable to group
      keyExtractor - a function to extract the key for grouping
      mapSupplier - a function to create the returned map
      Returns:
      a map where the keys are extracted from the elements and the values are lists of elements that share the same key. An empty map is returned if the input iterable is null or empty.
    • groupBy

      @Beta public static <T, K> Map<K,List<T>> groupBy(Iterator<? extends T> iter, Function<? super T,? extends K> keyExtractor)
      Groups the elements in the given iterator by the key extracted by the specified Function<T, K>.
      Type Parameters:
      T - the type of elements in the iterator
      K - the type of keys
      Parameters:
      iter - the iterator to group
      keyExtractor - a function to extract the key for grouping
      Returns:
      a map where the keys are extracted from the elements and the values are lists of elements that share the same key. An empty map is returned if the input iterator is null or empty.
    • groupBy

      @Beta public static <T, K, M extends Map<K, List<T>>> M groupBy(Iterator<? extends T> iter, Function<? super T,? extends K> keyExtractor, Supplier<M> mapSupplier)
      Groups the elements in the given iterator by the key extracted by the specified Function<T, K>.
      Type Parameters:
      T - the type of elements in the iterator
      K - the type of keys
      M - the type of returned map
      Parameters:
      iter - the iterator to group
      keyExtractor - a function to extract the key for grouping
      mapSupplier - a function to create the returned map
      Returns:
      a map where the keys are extracted from the elements and the values are lists of elements that share the same key. An empty map is returned if the input iterator is null or empty.
    • groupBy

      @Beta public static <T, K, V> Map<K,List<V>> groupBy(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor, Function<? super T,? extends V> valueExtractor)
      Groups the elements in the given iterable by the key extracted by the specified Function<T, K>. The values in the resulting map are lists of elements transformed by the value extractor function.
      Type Parameters:
      T - the type of elements in the input iterable
      K - the type of keys
      V - the type of values in the resulting lists
      Parameters:
      c - the input iterable to group
      keyExtractor - a function to extract the key for grouping
      valueExtractor - a function to extract the value for the resulting lists
      Returns:
      a map where the keys are extracted from the elements and the values are lists of elements transformed by the value extractor function. An empty map is returned if the input iterable is null or empty.
    • groupBy

      @Beta public static <T, K, V, M extends Map<K, List<V>>> M groupBy(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor, Function<? super T,? extends V> valueExtractor, Supplier<M> mapSupplier)
      Groups the elements in the given iterable by the key extracted by the specified Function<T, K>. The values in the resulting map are lists of elements transformed by the value extractor function.
      Type Parameters:
      T - the type of elements in the input iterable
      K - the type of keys
      V - the type of values in the resulting lists
      M - the type of returned map
      Parameters:
      c - the input iterable to group
      keyExtractor - a function to extract the key for grouping
      valueExtractor - a function to extract the value for the resulting lists
      mapSupplier - a function to create the returned map
      Returns:
      a map where the keys are extracted from the elements and the values are lists of elements transformed by the value extractor function. An empty map is returned if the input iterable is null or empty.
    • groupBy

      @Beta public static <T, K, V> Map<K,List<V>> groupBy(Iterator<? extends T> iter, Function<? super T,? extends K> keyExtractor, Function<? super T,? extends V> valueExtractor)
      Groups the elements in the given iterator by the key extracted by the specified Function<T, K>. The values in the resulting map are lists of elements transformed by the value extractor function.
      Type Parameters:
      T - the type of elements in the input iterator
      K - the type of keys
      V - the type of values in the resulting lists
      Parameters:
      iter - the input iterator to group
      keyExtractor - a function to extract the key for grouping
      valueExtractor - a function to extract the value for the resulting lists
      Returns:
      a map where the keys are extracted from the elements and the values are lists of elements transformed by the value extractor function. An empty map is returned if the input iterator is null or empty.
    • groupBy

      @Beta public static <T, K, V, M extends Map<K, List<V>>> M groupBy(Iterator<? extends T> iter, Function<? super T,? extends K> keyExtractor, Function<? super T,? extends V> valueExtractor, Supplier<M> mapSupplier)
      Groups the elements in the given iterator by the key extracted by the specified Function<T, K>. The values in the resulting map are lists of elements transformed by the value extractor function.
      Type Parameters:
      T - the type of elements in the input iterator
      K - the type of keys
      V - the type of values in the resulting lists
      M - the type of returned map
      Parameters:
      iter - the input iterator to group
      keyExtractor - a function to extract the key for grouping
      valueExtractor - a function to extract the value for the resulting lists
      mapSupplier - a function to create the returned map
      Returns:
      a map where the keys are extracted from the elements and the values are lists of elements transformed by the value extractor function. An empty map is returned if the input iterator is null or empty.
    • groupBy

      @Beta public static <T, K, R> Map<K,R> groupBy(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor, Collector<? super T,?,R> collector)
      Groups the elements in the given array by the key extracted by the specified Function<T, K>. The values in the resulting map are transformed by the specified collector.
      Type Parameters:
      T - the type of elements in the array
      K - the type of keys
      R - the type of values in the resulting map
      Parameters:
      keyExtractor - a function to extract the key for grouping
      collector - a collector that transforms the values
      a - the array to group
      Returns:
      a map where the keys are extracted from the elements and the values are transformed by the collector. An empty map is returned if the input array is null or empty.
    • groupBy

      @Beta public static <T, K, R, M extends Map<K, R>> M groupBy(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor, Collector<? super T,?,R> collector, Supplier<M> mapSupplier)
      Groups the elements in the given array by the key extracted by the specified Function<T, K>. The values in the resulting map are transformed by the specified collector.
      Type Parameters:
      T - the type of elements in the array
      K - the type of keys
      R - the type of values in the resulting map
      M - the type of returned map
      Parameters:
      keyExtractor - a function to extract the key for grouping
      collector - a collector that transforms the values
      mapSupplier - a function to create the returned map
      a - the array to group
      Returns:
      a map where the keys are extracted from the elements and the values are transformed by the collector. An empty map is returned if the input array is null or empty.
    • groupBy

      @Beta public static <K, T, R> Map<K,R> groupBy(Iterator<? extends T> iter, Function<? super T,? extends K> keyExtractor, Collector<? super T,?,R> collector)
      Groups the elements in the given iterator by the key extracted by the specified Function<T, K>. The values in the resulting map are transformed by the specified collector.
      Type Parameters:
      K - the type of keys
      T - the type of elements in the iterator
      R - the type of values in the resulting map
      Parameters:
      iter - the iterator to group
      keyExtractor - a function to extract the key for grouping
      collector - a collector that transforms the values
      Returns:
      a map where the keys are extracted from the elements and the values are transformed by the collector. An empty map is returned if the input iterator is null or empty.
    • groupBy

      @Beta public static <K, T, R, M extends Map<K, R>> M groupBy(Iterator<? extends T> iter, Function<? super T,? extends K> keyExtractor, Collector<? super T,?,R> collector, Supplier<M> mapSupplier)
      Groups the elements in the given iterator by the key extracted by the specified Function<T, K>. The values in the resulting map are transformed by the specified collector.
      Type Parameters:
      K - the type of keys
      T - the type of elements in the iterator
      R - the type of values in the resulting map
      M - the type of returned map
      Parameters:
      iter - the iterator to group
      keyExtractor - a function to extract the key for grouping
      collector - a collector that transforms the values
      mapSupplier - a function to create the returned map
      Returns:
      a map where the keys are extracted from the elements and the values are transformed by the collector. An empty map is returned if the input iterator is null or empty.
    • countBy

      @Beta public static <T, K> Map<K,Integer> countBy(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor)
      Counts the elements in the given iterable by the key extracted by the specified Function<T, K>. The resulting map contains the keys and the count of elements associated with each key.
      Type Parameters:
      T - the type of elements in the input iterable
      K - the type of keys
      Parameters:
      c - the input iterable to count
      keyExtractor - a function to extract the key for counting
      Returns:
      a map where the keys are extracted from the elements and the values are the count of elements associated with each key. An empty map is returned if the input iterable is null or empty.
    • countBy

      @Beta public static <T, K, M extends Map<K, Integer>> M countBy(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor, Supplier<M> mapSupplier)
      Counts the elements in the given iterable by the key extracted by the specified Function<T, K>. The resulting map contains the keys and the count of elements associated with each key.
      Type Parameters:
      T - the type of elements in the input iterable
      K - the type of keys
      M - the type of returned map
      Parameters:
      c - the input iterable to count
      keyExtractor - a function to extract the key for counting
      mapSupplier - a function to create the returned map
      Returns:
      a map where the keys are extracted from the elements and the values are the count of elements associated with each key. An empty map is returned if the input iterable is null or empty.
    • countBy

      @Beta public static <T, K> Map<K,Integer> countBy(Iterator<? extends T> iter, Function<? super T,? extends K> keyExtractor)
      Counts the elements in the given iterator by the key extracted by the specified Function<T, K>. The resulting map contains the keys and the count of elements associated with each key.
      Type Parameters:
      T - the type of elements in the input iterator
      K - the type of keys
      Parameters:
      iter - the input iterator to count
      keyExtractor - a function to extract the key for counting
      Returns:
      a map where the keys are extracted from the elements and the values are the count of elements associated with each key. An empty map is returned if the input iterator is null or empty.
    • countBy

      @Beta public static <T, K, M extends Map<K, Integer>> M countBy(Iterator<? extends T> iter, Function<? super T,? extends K> keyExtractor, Supplier<M> mapSupplier)
      Counts the elements in the given iterator by the key extracted by the specified Function<T, K>. The resulting map contains the keys and the count of elements associated with each key.
      Type Parameters:
      T - the type of elements in the input iterator
      K - the type of keys
      M - the type of returned map
      Parameters:
      iter - the input iterator to count
      keyExtractor - a function to extract the key for counting
      mapSupplier - a function to create the returned map
      Returns:
      a map where the keys are extracted from the elements and the values are the count of elements associated with each key. An empty map is returned if the input iterator is null or empty.
    • iterate

      @Beta public static <T> ObjIterator<T> iterate(T[] a)
      Returns an iterator over the elements in the specified array.
      Type Parameters:
      T - the type of elements in the array
      Parameters:
      a - the array to iterate over
      Returns:
      an iterator over the elements in the specified array
      See Also:
    • iterate

      @Beta public static <T> ObjIterator<T> iterate(T[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns an iterator over the elements within specified range in the given array.
      Type Parameters:
      T - the type of elements in the array
      Parameters:
      a - the array to iterate over
      fromIndex - the index of the first element (inclusive) to be iterated
      toIndex - the index of the last element (exclusive) to be iterated
      Returns:
      an iterator over the elements within specified range in the specified array
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
      See Also:
    • iterate

      @Beta public static <T> Iterator<T> iterate(Iterable<? extends T> iterable)
      Returns an iterator over the elements in the specified iterable.
      Type Parameters:
      T - the type of elements in the iterable
      Parameters:
      c - the iterable to iterate over
      Returns:
      an iterator over the elements in the specified iterable
      See Also:
    • iterateAll

      @Beta public static <T> List<Iterator<T>> iterateAll(Collection<? extends Iterable<? extends T>> iterables)
      Returns a list of iterators for each iterable in the specified collection of iterables.
      Type Parameters:
      T - the type of elements in the iterables
      Parameters:
      iterables - the collection of iterables to iterate over
      Returns:
      a list of iterators for each iterable in the specified collection
    • disjoint

      public static boolean disjoint(Object[] a, Object[] b)
      Checks if the two specified arrays have no elements in common.
      Parameters:
      a - the first array to be checked
      b - the second array to be checked
      Returns:
      true if the two arrays have no elements in common or either of specified arrays is null or empty, false otherwise.
      See Also:
    • disjoint

      public static boolean disjoint(Collection<?> c1, Collection<?> c2)
      Checks if the two specified collections have no elements in common.
      Parameters:
      c1 - the first collection to be checked
      c2 - the second collection to be checked
      Returns:
      true if the two collections have no elements in common or either of specified collections is null or empty, false otherwise.
      See Also:
    • toJson

      public static String toJson(Object obj)
      Converts the given object to its JSON string representation.
      Parameters:
      obj - the object to be converted to JSON
      Returns:
      a JSON string representation in the given object
    • toJson

      public static String toJson(Object obj, boolean prettyFormat)
      Converts the given object to its JSON string representation with an option for pretty formatting.
      Parameters:
      obj - the object to be converted to JSON
      prettyFormat - a boolean flag that indicates whether the output JSON should be formatted with indents and line breaks for easier reading or not.
      Returns:
      a JSON string representation in the given object.
    • toJson

      public static String toJson(Object obj, JSONSerializationConfig config)
      Converts the given object to its JSON string representation with the specified JSONSerializationConfig.
      Parameters:
      obj - the object to be converted to JSON
      config - the JSON serialization configuration
      Returns:
      a JSON string representation in the given object
    • toJson

      public static void toJson(Object obj, File output)
      Converts the given object to its JSON string representation and writes it to the specified file.
      Parameters:
      obj - the object to be converted to JSON
      output - the file to which the JSON string representation of the object will be written
    • toJson

      public static void toJson(Object obj, JSONSerializationConfig config, File output)
      Converts the given object to its JSON string representation with an option for pretty formatting and writes it to the specified file.
      Parameters:
      obj - the object to be converted to JSON
      config - the JSON serialization configuration
      output - the file to which the JSON string representation of the object will be written
    • toJson

      public static void toJson(Object obj, OutputStream output)
      Converts the given object to its JSON string representation and writes it to the specified output stream.
      Parameters:
      obj - the object to be converted to JSON
      output - the output stream to which the JSON string representation of the object will be written
    • toJson

      public static void toJson(Object obj, JSONSerializationConfig config, OutputStream output)
      Converts the given object to its JSON string representation with an option for pretty formatting and writes it to the specified output stream.
      Parameters:
      obj - the object to be converted to JSON
      config - the JSON serialization configuration
      output - the output stream to which the JSON string representation of the object will be written
    • toJson

      public static void toJson(Object obj, Writer output)
      Converts the given object to its JSON string representation and writes it to the specified writer.
      Parameters:
      obj - the object to be converted to JSON
      output - the writer to which the JSON string representation of the object will be written
    • toJson

      public static void toJson(Object obj, JSONSerializationConfig config, Writer output)
      Converts the given object to its JSON string representation with an option for pretty formatting and writes it to the specified writer.
      Parameters:
      obj - the object to be converted to JSON
      config - the JSON serialization configuration
      output - the writer to which the JSON string representation of the object will be written
    • fromJson

      public static <T> T fromJson(String json, Class<? extends T> targetType)
      Deserializes the given JSON string into an object of the specified target type.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      json - the JSON string to be deserialized
      targetType - the type the given JSON string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      an object of type T deserialized from the JSON string
      Throws:
      IllegalArgumentException - if the specified target type is null.
      See Also:
    • fromJson

      public static <T> T fromJson(String json, com.landawn.abacus.type.Type<? extends T> targetType)
      Deserializes the given JSON string into an object of the specified target type.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      json - the JSON string to be deserialized
      targetType - the type the given JSON string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      an object of type T deserialized from the JSON string
      Throws:
      IllegalArgumentException - if the specified target type is null.
      See Also:
    • fromJson

      public static <T> T fromJson(String json, T defaultIfNull, Class<? extends T> targetType)
      Deserializes the given JSON string into an object of the specified target type. If the deserialized object is null, returns the provided default value.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      json - the JSON string to be deserialized
      defaultIfNull - the default value to return if the deserialized object is null
      targetType - the type the given JSON string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      an object of type T deserialized from the JSON string, or defaultIfNull if the deserialized object is null
      Throws:
      IllegalArgumentException - if the specified target type is null.
      See Also:
    • fromJson

      public static <T> T fromJson(String json, T defaultIfNull, com.landawn.abacus.type.Type<? extends T> targetType)
      Deserializes the given JSON string into an object of the specified target type. If the deserialized object is null, returns the provided default value.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      json - the JSON string to be deserialized
      targetType - the type the given JSON string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      targetType - can be the Type of Bean/Array/Collection/Map.
      Returns:
      an object of type T deserialized from the JSON string, or defaultIfNull if the deserialized object is null
      Throws:
      IllegalArgumentException - if the specified target type is null.
      See Also:
    • fromJson

      public static <T> T fromJson(String json, JSONDeserializationConfig config, Class<? extends T> targetType)
      Deserializes the given JSON string into an object of the specified target type with the specified JSONDeserializationConfig.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      json - the JSON string to be deserialized
      config - the JSON deserialization configuration
      targetType - the type the given JSON string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      an object of type T deserialized from the JSON string
      Throws:
      IllegalArgumentException - if the specified target type is null.
      See Also:
    • fromJson

      public static <T> T fromJson(String json, JSONDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> targetType)
      Deserializes the given JSON string into an object of the specified target type with the specified JSONDeserializationConfig.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      json - the JSON string to be deserialized
      config - the JSON deserialization configuration
      targetType - the type the given JSON string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      an object of type T deserialized from the JSON string
      Throws:
      IllegalArgumentException - if the specified target type is null.
      See Also:
    • fromJson

      public static <T> T fromJson(File json, Class<? extends T> targetType)
      Deserializes the given JSON string from the specified file into an object of the specified target type.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      json - the file where the given JSON string is read to be deserialized
      targetType - the type the given JSON string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      an object of type T deserialized from the JSON string
      Throws:
      IllegalArgumentException - if the specified target type is null.
      See Also:
    • fromJson

      public static <T> T fromJson(File json, com.landawn.abacus.type.Type<? extends T> targetType)
      Deserializes the given JSON string from the specified file into an object of the specified target type.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      json - the file where the given JSON string is read to be deserialized
      targetType - the type the given JSON string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      an object of type T deserialized from the JSON string
      Throws:
      IllegalArgumentException - if the specified target type is null.
      See Also:
    • fromJson

      public static <T> T fromJson(File json, JSONDeserializationConfig config, Class<? extends T> targetType)
      Deserializes the given JSON string from the specified file into an object of the specified target type with the specified JSONDeserializationConfig.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      json - the file where the given JSON string is read to be deserialized
      config - the JSON deserialization configuration
      targetType - the type the given JSON string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      an object of type T deserialized from the JSON string
      Throws:
      IllegalArgumentException - if the specified target type is null.
      See Also:
    • fromJson

      public static <T> T fromJson(File json, JSONDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> targetType)
      Deserializes the given JSON string from the specified file into an object of the specified target type with the specified JSONDeserializationConfig.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      json - the file where the given JSON string is read to be deserialized
      config - the JSON deserialization configuration
      targetType - the type the given JSON string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      an object of type T deserialized from the JSON string
      Throws:
      IllegalArgumentException - if the specified target type is null.
      See Also:
    • fromJson

      public static <T> T fromJson(InputStream json, Class<? extends T> targetType)
      Deserializes the given JSON string from the specified input stream into an object of the specified target type.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      json - the input stream where the given JSON string is read to be deserialized
      targetType - the type the given JSON string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      an object of type T deserialized from the JSON string
      Throws:
      IllegalArgumentException - if the specified target type is null.
      See Also:
    • fromJson

      public static <T> T fromJson(InputStream json, com.landawn.abacus.type.Type<? extends T> targetType)
      Deserializes the given JSON string from the specified input stream into an object of the specified target type.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      json - the input stream where the given JSON string is read to be deserialized
      targetType - the type the given JSON string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      an object of type T deserialized from the JSON string
      Throws:
      IllegalArgumentException - if the specified target type is null.
      See Also:
    • fromJson

      public static <T> T fromJson(InputStream json, JSONDeserializationConfig config, Class<? extends T> targetType)
      Deserializes the given JSON string from the specified input stream into an object of the specified target type with the specified JSONDeserializationConfig.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      json - the input stream where the given JSON string is read to be deserialized
      config - the JSON deserialization configuration
      targetType - the type the given JSON string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      an object of type T deserialized from the JSON string
      Throws:
      IllegalArgumentException - if the specified target type is null.
      See Also:
    • fromJson

      public static <T> T fromJson(InputStream json, JSONDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> targetType)
      Deserializes the given JSON string from the specified input stream into an object of the specified target type with the specified JSONDeserializationConfig.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      json - the input stream where the given JSON string is read to be deserialized
      config - the JSON deserialization configuration
      targetType - the type the given JSON string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      an object of type T deserialized from the JSON string
      Throws:
      IllegalArgumentException - if the specified target type is null.
      See Also:
    • fromJson

      public static <T> T fromJson(Reader json, Class<? extends T> targetType)
      Deserializes the given JSON string from the specified reader into an object of the specified target type.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      json - the reader where the given JSON string is read to be deserialized
      targetType - the type the given JSON string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      an object of type T deserialized from the JSON string
      Throws:
      IllegalArgumentException - if the specified target type is null.
      See Also:
    • fromJson

      public static <T> T fromJson(Reader json, com.landawn.abacus.type.Type<? extends T> targetType)
      Deserializes the given JSON string from the specified reader into an object of the specified target type.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      json - the reader where the given JSON string is read to be deserialized
      targetType - the type the given JSON string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      an object of type T deserialized from the JSON string
      Throws:
      IllegalArgumentException - if the specified target type is null.
      See Also:
    • fromJson

      public static <T> T fromJson(Reader json, JSONDeserializationConfig config, Class<? extends T> targetType)
      Deserializes the given JSON string from the specified reader into an object of the specified target type with the specified JSONDeserializationConfig.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      json - the reader where the given JSON string is read to be deserialized
      config - the JSON deserialization configuration
      targetType - the type the given JSON string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      an object of type T deserialized from the JSON string
      Throws:
      IllegalArgumentException - if the specified target type is null.
      See Also:
    • fromJson

      public static <T> T fromJson(Reader json, JSONDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> targetType)
      Deserializes the given JSON string from the specified reader into an object of the specified target type with the specified JSONDeserializationConfig.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      json - the reader where the given JSON string is read to be deserialized
      config - the JSON deserialization configuration
      targetType - the type the given JSON string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      an object of type T deserialized from the JSON string
      Throws:
      IllegalArgumentException - if the specified target type is null.
      See Also:
    • fromJson

      public static <T> T fromJson(String json, int fromIndex, int toIndex, Class<? extends T> targetType) throws IndexOutOfBoundsException
      Deserializes the given JSON sub-string in the specified range into an object of the specified target type.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      json - the JSON string to be deserialized
      fromIndex - the index of the first character (inclusive) to be deserialized
      toIndex - the index of the last character (exclusive) to be deserialized
      targetType - the type the given JSON string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      an object of type T deserialized from the JSON string
      Throws:
      IllegalArgumentException - if the specified target type is null.
      IndexOutOfBoundsException - if the specified range is out of bounds
      See Also:
    • fromJson

      public static <T> T fromJson(String json, int fromIndex, int toIndex, com.landawn.abacus.type.Type<? extends T> targetType) throws IndexOutOfBoundsException
      Deserializes the given JSON sub-string in the specified range into an object of the specified target type.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      json - the JSON string to be deserialized
      fromIndex - the index of the first character (inclusive) to be deserialized
      toIndex - the index of the last character (exclusive) to be deserialized
      targetType - the type the given JSON string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      an object of type T deserialized from the JSON string
      Throws:
      IllegalArgumentException - if the specified target type is null.
      IndexOutOfBoundsException - if the specified range is out of bounds
      See Also:
    • fromJson

      public static <T> T fromJson(String json, int fromIndex, int toIndex, JSONDeserializationConfig config, Class<? extends T> targetType)
      Deserializes the given JSON sub-string in the specified range into an object of the specified target type with the specified JSONDeserializationConfig.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      json - the JSON string to be deserialized
      config - the JSON deserialization configuration
      targetType - the type the given JSON string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      an object of type T deserialized from the JSON string
      Throws:
      IllegalArgumentException - if the specified target type is null.
      IndexOutOfBoundsException - if the specified range is out of bounds
      See Also:
    • fromJson

      public static <T> T fromJson(String json, int fromIndex, int toIndex, JSONDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> targetType) throws IndexOutOfBoundsException
      Deserializes the given JSON sub-string in the specified range into an object of the specified target type with the specified JSONDeserializationConfig.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      json - the JSON string to be deserialized
      fromIndex - the index of the first character (inclusive) to be deserialized
      toIndex - the index of the last character (exclusive) to be deserialized
      config - the JSON deserialization configuration
      targetType - the type the given JSON string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      an object of type T deserialized from the JSON string
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
      IllegalArgumentException - if the specified target type is null.
      See Also:
    • streamJson

      public static <T> Stream<T> streamJson(String jsonArray, Class<? extends T> elementType)
      Creates a stream of elements deserialized from the given JSON array string with the specified target type.
      Type Parameters:
      T - the type of the elements in the JSON array
      Parameters:
      jsonArray - the JSON array string to be streamed
      elementType - the type the given JSON array element will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      a stream of elements deserialized from the given JSON array
      Throws:
      IllegalArgumentException - if the specified element type is null.
      See Also:
    • streamJson

      public static <T> Stream<T> streamJson(String jsonArray, com.landawn.abacus.type.Type<? extends T> elementType)
      Creates a stream of elements deserialized from the given JSON array string with the specified target type.
      Type Parameters:
      T - the type of the elements in the JSON array
      Parameters:
      jsonArray - the JSON array string to be streamed
      elementType - the type the given JSON array element will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      a stream of elements deserialized from the given JSON array
      Throws:
      IllegalArgumentException - if the specified element type is null.
      See Also:
    • streamJson

      public static <T> Stream<T> streamJson(String jsonArray, JSONDeserializationConfig config, Class<? extends T> elementType)
      Creates a stream of elements deserialized from the given JSON array string with the specified target type and JSONDeserializationConfig.
      Type Parameters:
      T - the type of the elements in the JSON array
      Parameters:
      jsonArray - the JSON array string to be streamed
      config - the JSON deserialization configuration
      elementType - the type the given JSON array element will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      a stream of elements deserialized from the given JSON array
      Throws:
      IllegalArgumentException - if the specified element type is null.
      See Also:
    • streamJson

      public static <T> Stream<T> streamJson(String jsonArray, JSONDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> elementType)
      Creates a stream of elements deserialized from the given JSON array string with the specified target type and JSONDeserializationConfig.
      Type Parameters:
      T - the type of the elements in the JSON array
      Parameters:
      jsonArray - the JSON array string to be streamed
      config - the JSON deserialization configuration
      elementType - the type the given JSON array element will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      a stream of elements deserialized from the given JSON array
      Throws:
      IllegalArgumentException - if the specified element type is null.
      See Also:
    • streamJson

      public static <T> Stream<T> streamJson(File jsonArray, Class<? extends T> elementType)
      Creates a stream of elements deserialized from the given JSON array in the specified file with the specified target type.
      Type Parameters:
      T - the type of the elements in the JSON array
      Parameters:
      jsonArray - the JSON array file to be streamed
      elementType - the type the given JSON array element will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      a stream of elements deserialized from the given JSON array
      Throws:
      IllegalArgumentException - if the specified element type is null.
      See Also:
    • streamJson

      public static <T> Stream<T> streamJson(File jsonArray, com.landawn.abacus.type.Type<? extends T> elementType)
      Creates a stream of elements deserialized from the given JSON array in the specified file with the specified target type.
      Type Parameters:
      T - the type of the elements in the JSON array
      Parameters:
      jsonArray - the JSON array file to be streamed
      elementType - the type the given JSON array element will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      a stream of elements deserialized from the given JSON array
      Throws:
      IllegalArgumentException - if the specified element type is null.
      See Also:
    • streamJson

      public static <T> Stream<T> streamJson(File jsonArray, JSONDeserializationConfig config, Class<? extends T> elementType)
      Creates a stream of elements deserialized from the given JSON array in the specified file with the specified target type and JSONDeserializationConfig.
      Type Parameters:
      T - the type of the elements in the JSON array
      Parameters:
      jsonArray - the JSON array file to be streamed
      config - the JSON deserialization configuration
      elementType - the type the given JSON array element will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      a stream of elements deserialized from the given JSON array
      Throws:
      IllegalArgumentException - if the specified element type is null.
      See Also:
    • streamJson

      public static <T> Stream<T> streamJson(File jsonArray, JSONDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> elementType)
      Creates a stream of elements deserialized from the given JSON array in the specified file with the specified target type and JSONDeserializationConfig.
      Type Parameters:
      T - the type of the elements in the JSON array
      Parameters:
      jsonArray - the JSON array file to be streamed
      config - the JSON deserialization configuration
      elementType - the type the given JSON array element will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      a stream of elements deserialized from the given JSON array
      Throws:
      IllegalArgumentException - if the specified element type is null.
      See Also:
    • streamJson

      public static <T> Stream<T> streamJson(InputStream jsonArray, Class<? extends T> elementType)
      Creates a stream of elements deserialized from the given JSON array in the specified input stream with the specified target type.
      Type Parameters:
      T - the type of the elements in the JSON array
      Parameters:
      jsonArray - the input stream where the given JSON array is read to be streamed
      elementType - the type the given JSON array element will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      a stream of elements deserialized from the given JSON array
      Throws:
      IllegalArgumentException - if the specified element type is null.
      See Also:
    • streamJson

      public static <T> Stream<T> streamJson(InputStream jsonArray, com.landawn.abacus.type.Type<? extends T> elementType)
      Creates a stream of elements deserialized from the given JSON array in the specified input stream with the specified target type.
      Type Parameters:
      T - the type of the elements in the JSON array
      Parameters:
      jsonArray - the input stream where the given JSON array is read to be streamed
      elementType - the type the given JSON array element will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      a stream of elements deserialized from the given JSON array
      Throws:
      IllegalArgumentException - if the specified element type is null.
      See Also:
    • streamJson

      public static <T> Stream<T> streamJson(InputStream jsonArray, boolean closeInputStreamWhenStreamIsClosed, Class<? extends T> elementType)
      Creates a stream of elements deserialized from the given JSON array in the specified input stream with the specified target type and JSONDeserializationConfig.
      Type Parameters:
      T - the type of the elements in the JSON array
      Parameters:
      jsonArray - the input stream where the given JSON array is read to be streamed
      closeInputStreamWhenStreamIsClosed - the flag indicating whether to close the input stream when the stream is closed
      elementType - the type the given JSON array element will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      a stream of elements deserialized from the given JSON array
      Throws:
      IllegalArgumentException - if the specified element type is null.
      See Also:
    • streamJson

      public static <T> Stream<T> streamJson(InputStream jsonArray, boolean closeInputStreamWhenStreamIsClosed, com.landawn.abacus.type.Type<? extends T> elementType)
      Creates a stream of elements deserialized from the given JSON array in the specified input stream with the specified target type and JSONDeserializationConfig.
      Type Parameters:
      T - the type of the elements in the JSON array
      Parameters:
      jsonArray - the input stream where the given JSON array is read to be streamed
      closeInputStreamWhenStreamIsClosed - the flag indicating whether to close the input stream when the stream is closed
      elementType - the type the given JSON array element will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      a stream of elements deserialized from the given JSON array
      Throws:
      IllegalArgumentException - if the specified element type is null.
      See Also:
    • streamJson

      public static <T> Stream<T> streamJson(InputStream jsonArray, JSONDeserializationConfig config, boolean closeInputStreamWhenStreamIsClosed, Class<? extends T> elementType)
      Creates a stream of elements deserialized from the given JSON array in the specified input stream with the specified target type and JSONDeserializationConfig.
      Type Parameters:
      T - the type of the elements in the JSON array
      Parameters:
      jsonArray - the input stream where the given JSON array is read to be streamed
      config - the JSON deserialization configuration
      closeInputStreamWhenStreamIsClosed - the flag indicating whether to close the input stream when the stream is closed
      elementType - the type the given JSON array element will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      a stream of elements deserialized from the given JSON array
      Throws:
      IllegalArgumentException - if the specified element type is null.
      See Also:
    • streamJson

      public static <T> Stream<T> streamJson(InputStream jsonArray, JSONDeserializationConfig config, boolean closeInputStreamWhenStreamIsClosed, com.landawn.abacus.type.Type<? extends T> elementType)
      Creates a stream of elements deserialized from the given JSON array in the specified input stream with the specified target type and JSONDeserializationConfig.
      Type Parameters:
      T - the type of the elements in the JSON array
      Parameters:
      jsonArray - the input stream where the given JSON array is read to be streamed
      config - the JSON deserialization configuration
      closeInputStreamWhenStreamIsClosed - the flag indicating whether to close the input stream when the stream is closed
      elementType - the type the given JSON array element will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      a stream of elements deserialized from the given JSON array
      Throws:
      IllegalArgumentException - if the specified element type is null.
      See Also:
    • streamJson

      public static <T> Stream<T> streamJson(Reader jsonArray, Class<? extends T> elementType)
      Creates a stream of elements deserialized from the given JSON array in the specified reader with the specified target type.
      Type Parameters:
      T - the type of the elements in the JSON array
      Parameters:
      jsonArray - the reader where the given JSON array is read to be streamed
      elementType - the type the given JSON array element will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      a stream of elements deserialized from the given JSON array
      Throws:
      IllegalArgumentException - if the specified element type is null.
      See Also:
    • streamJson

      public static <T> Stream<T> streamJson(Reader jsonArray, com.landawn.abacus.type.Type<? extends T> elementType)
      Creates a stream of elements deserialized from the given JSON array in the specified reader with the specified target type.
      Type Parameters:
      T - the type of the elements in the JSON array
      Parameters:
      jsonArray - the reader where the given JSON array is read to be streamed
      elementType - the type the given JSON array element will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      a stream of elements deserialized from the given JSON array
      Throws:
      IllegalArgumentException - if the specified element type is null.
      See Also:
    • streamJson

      public static <T> Stream<T> streamJson(Reader jsonArray, boolean closeReaderWhenStreamIsClosed, Class<? extends T> elementType)
      Creates a stream of elements deserialized from the given JSON array in the specified reader with the specified target type and JSONDeserializationConfig.
      Type Parameters:
      T - the type of the elements in the JSON array
      Parameters:
      jsonArray - the reader where the given JSON array is read to be streamed
      closeReaderWhenStreamIsClosed - the flag indicating whether to close the reader when the stream is closed
      elementType - the type the given JSON array element will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      a stream of elements deserialized from the given JSON array
      Throws:
      IllegalArgumentException - if the specified element type is null.
      See Also:
    • streamJson

      public static <T> Stream<T> streamJson(Reader jsonArray, boolean closeReaderWhenStreamIsClosed, com.landawn.abacus.type.Type<? extends T> elementType)
      Creates a stream of elements deserialized from the given JSON array in the specified reader with the specified target type and JSONDeserializationConfig.
      Type Parameters:
      T - the type of the elements in the JSON array
      Parameters:
      jsonArray - the reader where the given JSON array is read to be streamed
      closeReaderWhenStreamIsClosed - the flag indicating whether to close the reader when the stream is closed
      elementType - the type the given JSON array element will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      a stream of elements deserialized from the given JSON array
      Throws:
      IllegalArgumentException - if the specified element type is null.
      See Also:
    • streamJson

      public static <T> Stream<T> streamJson(Reader jsonArray, JSONDeserializationConfig config, boolean closeReaderWhenStreamIsClosed, Class<? extends T> elementType)
      Creates a stream of elements deserialized from the given JSON array in the specified reader with the specified target type and JSONDeserializationConfig.
      Type Parameters:
      T - the type of the elements in the JSON array
      Parameters:
      jsonArray - the reader where the given JSON array is read to be streamed
      config - the JSON deserialization configuration
      closeReaderWhenStreamIsClosed - the flag indicating whether to close the reader when the stream is closed
      elementType - the type the given JSON array element will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      a stream of elements deserialized from the given JSON array
      Throws:
      IllegalArgumentException - if the specified element type is null.
      See Also:
    • streamJson

      public static <T> Stream<T> streamJson(Reader jsonArray, JSONDeserializationConfig config, boolean closeReaderWhenStreamIsClosed, com.landawn.abacus.type.Type<? extends T> elementType)
      Creates a stream of elements deserialized from the given JSON array in the specified reader with the specified target type and JSONDeserializationConfig.
      Type Parameters:
      T - the type of the elements in the JSON array
      Parameters:
      jsonArray - the reader where the given JSON array is read to be streamed
      config - the JSON deserialization configuration
      closeReaderWhenStreamIsClosed - the flag indicating whether to close the reader when the stream is closed
      elementType - the type the given JSON array element will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      a stream of elements deserialized from the given JSON array
      Throws:
      IllegalArgumentException - if the specified element type is null.
      See Also:
    • formatJson

      public static String formatJson(String json)
      Formats the given JSON string to its pretty-printed JSON format with indents and line breaks for easier reading.
      Parameters:
      json - the JSON string to be formatted
      Returns:
      the formatted JSON string
    • formatJson

      public static String formatJson(String json, Class<?> transferType)
      Formats the given JSON string to its pretty-printed JSON format with indents and line breaks for easier reading.
      Parameters:
      json - the JSON string to be formatted
      transferType - the type the given JSON string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      the formatted JSON string
    • formatJson

      public static String formatJson(String json, com.landawn.abacus.type.Type<?> transferType)
      Formats the given JSON string to its pretty-printed JSON format with indents and line breaks for easier reading.
      Parameters:
      json - the JSON string to be formatted
      transferType - the type the given JSON string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      the formatted JSON string
    • formatJson

      public static String formatJson(String json, JSONSerializationConfig config)
      Formats the given JSON string to its pretty-printed JSON format with indents and line breaks for easier reading.
      Parameters:
      json - the JSON string to be formatted
      config - the JSON serialization configuration
      Returns:
      the formatted JSON string
    • formatJson

      public static String formatJson(String json, JSONSerializationConfig config, Class<?> transferType)
      Formats the given JSON string to its pretty-printed JSON format with indents and line breaks for easier reading.
      Parameters:
      json - the JSON string to be formatted
      config - the JSON serialization configuration
      transferType - the type the given JSON string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      the formatted JSON string
    • formatJson

      public static String formatJson(String json, JSONSerializationConfig config, com.landawn.abacus.type.Type<?> transferType)
      Formats the given JSON string to its pretty-printed JSON format with indents and line breaks for easier reading.
      Parameters:
      json - the JSON string to be formatted
      config - the JSON serialization configuration
      transferType - the type the given JSON string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet or serializable single value type, e.g. String, Integer, Date
      Returns:
      the formatted JSON string
    • toXml

      public static String toXml(Object obj)
      Converts the given object into an XML string representation.
      Parameters:
      obj - the object to be converted into an XML string.
      Returns:
      an XML string representation in the given object.
    • toXml

      public static String toXml(Object obj, boolean prettyFormat)
      Converts the given object to its XML string representation with an option for pretty formatting.
      Parameters:
      obj - the object to be converted to XML
      prettyFormat - a boolean flag that indicates whether the output XML should be formatted with indents and line breaks for easier reading or not.
      Returns:
      a XML string representation in the given object.
    • toXml

      public static String toXml(Object obj, XMLSerializationConfig config)
      Converts the given object to its XML string representation with the specified XMLSerializationConfig.
      Parameters:
      obj - the object to be converted to XML
      config - the XML serialization configuration
      Returns:
      a XML string representation in the given object.
    • toXml

      public static void toXml(Object obj, File output)
      Converts the given object to its XML string representation and writes it to the specified file.
      Parameters:
      obj - the object to be converted to XML
      output - the file to which the XML string representation of the object will be written
    • toXml

      public static void toXml(Object obj, XMLSerializationConfig config, File output)
      Converts the given object to its XML string representation with the specified XMLSerializationConfig and writes it to the specified file.
      Parameters:
      obj - the object to be converted to XML
      config - the XML serialization configuration
      output - the file to which the XML string representation of the object will be written
    • toXml

      public static void toXml(Object obj, OutputStream output)
      Converts the given object to its XML string representation and writes it to the specified output stream.
      Parameters:
      obj - the object to be converted to XML
      output - the output stream to which the XML string representation of the object will be written
    • toXml

      public static void toXml(Object obj, XMLSerializationConfig config, OutputStream output)
      Converts the given object to its XML string representation with the specified XMLSerializationConfig and writes it to the specified output stream.
      Parameters:
      obj - the object to be converted to XML
      config - the XML serialization configuration
      output - the output stream to which the XML string representation of the object will be written
    • toXml

      public static void toXml(Object obj, Writer output)
      Converts the given object to its XML string representation and writes it to the specified writer.
      Parameters:
      obj - the object to be converted to XML
      output - the writer to which the XML string representation of the object will be written
    • toXml

      public static void toXml(Object obj, XMLSerializationConfig config, Writer output)
      Converts the given object to its XML string representation with the specified XMLSerializationConfig and writes it to the specified writer.
      Parameters:
      obj - the object to be converted to XML
      config - the XML serialization configuration
      output - the writer to which the XML string representation of the object will be written
    • fromXml

      public static <T> T fromXml(String xml, Class<? extends T> targetType)
      Deserializes the given XML string into an object of the specified target type.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      xml - the XML string to be deserialized
      targetType - the type the given XML string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet.
      Returns:
      an object of type T deserialized from the XML string
      Throws:
      IllegalArgumentException - if the specified target type is null.
      See Also:
    • fromXml

      public static <T> T fromXml(String xml, com.landawn.abacus.type.Type<? extends T> targetType)
      Deserializes the given XML string into an object of the specified target type.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      xml - the XML string to be deserialized
      targetType - the type the given XML string will be deserialized to. It can be the Type of Bean/Array/Collection/Map.
      Returns:
      an object of type T deserialized from the XML string
      Throws:
      IllegalArgumentException - if the specified target type is null.
      See Also:
    • fromXml

      public static <T> T fromXml(String xml, XMLDeserializationConfig config, Class<? extends T> targetType)
      Deserializes the given XML string into an object of the specified target type with the specified XMLDeserializationConfig.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      xml - the XML string to be deserialized
      config - the XML deserialization configuration
      targetType - the type the given XML string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet.
      Returns:
      an object of type T deserialized from the XML string
      Throws:
      IllegalArgumentException - if the specified target type is null.
      See Also:
    • fromXml

      public static <T> T fromXml(String xml, XMLDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> targetType)
      Deserializes the given XML string into an object of the specified target type with the specified XMLDeserializationConfig.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      xml - the XML string to be deserialized
      config - the XML deserialization configuration
      targetType - the type the given XML string will be deserialized to. It can be the Type of Bean/Array/Collection/Map.
      Returns:
      an object of type T deserialized from the XML string
      Throws:
      IllegalArgumentException - if the specified target type is null.
      See Also:
    • fromXml

      public static <T> T fromXml(File xml, Class<? extends T> targetType)
      Deserializes the given XML string from the specified file into an object of the specified target type.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      xml - the file where the given XML string is read to be deserialized
      targetType - the type the given XML string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet.
      Returns:
      an object of type T deserialized from the XML string
      Throws:
      IllegalArgumentException - if the specified target type is null.
      See Also:
    • fromXml

      public static <T> T fromXml(File xml, com.landawn.abacus.type.Type<? extends T> targetType)
      Deserializes the given XML string from the specified file into an object of the specified target type.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      xml - the file where the given XML string is read to be deserialized
      targetType - the type the given XML string will be deserialized to. It can be the Type of Bean/Array/Collection/Map.
      Returns:
      an object of type T deserialized from the XML string
      Throws:
      IllegalArgumentException - if the specified target type is null.
      See Also:
    • fromXml

      public static <T> T fromXml(File xml, XMLDeserializationConfig config, Class<? extends T> targetType)
      Deserializes the given XML string from the specified file into an object of the specified target type with the specified XMLDeserializationConfig.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      xml - the file where the given XML string is read to be deserialized
      config - the XML deserialization configuration
      targetType - the type the given XML string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet.
      Returns:
      an object of type T deserialized from the XML string
      Throws:
      IllegalArgumentException - if the specified target type is null.
      See Also:
    • fromXml

      public static <T> T fromXml(File xml, XMLDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> targetType)
      Deserializes the given XML string from the specified file into an object of the specified target type with the specified XMLDeserializationConfig.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      xml - the file where the given XML string is read to be deserialized
      config - the XML deserialization configuration
      targetType - the type the given XML string will be deserialized to. It can be the Type of Bean/Array/Collection/Map.
      Returns:
      an object of type T deserialized from the XML string
      Throws:
      IllegalArgumentException - if the specified target type is null.
      See Also:
    • fromXml

      public static <T> T fromXml(InputStream xml, Class<? extends T> targetType)
      Deserializes the given XML string from the specified input stream into an object of the specified target type.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      xml - the input stream where the given XML string is read to be deserialized
      targetType - the type the given XML string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet.
      Returns:
      an object of type T deserialized from the XML string
      Throws:
      IllegalArgumentException - if the specified target type is null.
      See Also:
    • fromXml

      public static <T> T fromXml(InputStream xml, com.landawn.abacus.type.Type<? extends T> targetType)
      Deserializes the given XML string from the specified input stream into an object of the specified target type.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      xml - the input stream where the given XML string is read to be deserialized
      targetType - the type the given XML string will be deserialized to. It can be the Type of Bean/Array/Collection/Map.
      Returns:
      an object of type T deserialized from the XML string
      Throws:
      IllegalArgumentException - if the specified target type is null.
      See Also:
    • fromXml

      public static <T> T fromXml(InputStream xml, XMLDeserializationConfig config, Class<? extends T> targetType)
      Deserializes the given XML string from the specified input stream into an object of the specified target type with the specified XMLDeserializationConfig.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      xml - the input stream where the given XML string is read to be deserialized
      config - the XML deserialization configuration
      targetType - the type the given XML string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet.
      Returns:
      an object of type T deserialized from the XML string
      Throws:
      IllegalArgumentException - if the specified target type is null.
      See Also:
    • fromXml

      public static <T> T fromXml(InputStream xml, XMLDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> targetType)
      Deserializes the given XML string from the specified input stream into an object of the specified target type with the specified XMLDeserializationConfig.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      xml - the input stream where the given XML string is read to be deserialized
      config - the XML deserialization configuration
      targetType - the type the given XML string will be deserialized to. It can be the Type of Bean/Array/Collection/Map.
      Returns:
      an object of type T deserialized from the XML string
      Throws:
      IllegalArgumentException - if the specified target type is null.
      See Also:
    • fromXml

      public static <T> T fromXml(Reader xml, Class<? extends T> targetType)
      Deserializes the given XML string from the specified reader into an object of the specified target type.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      xml - the reader where the given XML string is read to be deserialized
      targetType - the type the given XML string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet.
      Returns:
      an object of type T deserialized from the XML string
      Throws:
      IllegalArgumentException - if the specified target type is null.
      See Also:
    • fromXml

      public static <T> T fromXml(Reader xml, com.landawn.abacus.type.Type<? extends T> targetType)
      Deserializes the given XML string from the specified reader into an object of the specified target type.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      xml - the reader where the given XML string is read to be deserialized
      targetType - the type the given XML string will be deserialized to. It can be the Type of Bean/Array/Collection/Map.
      Returns:
      an object of type T deserialized from the XML string
      Throws:
      IllegalArgumentException - if the specified target type is null.
      See Also:
    • fromXml

      public static <T> T fromXml(Reader xml, XMLDeserializationConfig config, Class<? extends T> targetType)
      Deserializes the given XML string from the specified reader into an object of the specified target type with the specified XMLDeserializationConfig.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      xml - the reader where the given XML string is read to be deserialized
      config - the XML deserialization configuration
      targetType - the type the given XML string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet.
      Returns:
      an object of type T deserialized from the XML string
      Throws:
      IllegalArgumentException - if the specified target type is null.
      See Also:
    • fromXml

      public static <T> T fromXml(Reader xml, XMLDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> targetType)
      Deserializes the given XML string from the specified reader into an object of the specified target type with the specified XMLDeserializationConfig.
      Type Parameters:
      T - the type of the object to be returned
      Parameters:
      xml - the reader where the given XML string is read to be deserialized
      config - the XML deserialization configuration
      targetType - the type the given XML string will be deserialized to. It can be the Type of Bean/Array/Collection/Map.
      Returns:
      an object of type T deserialized from the XML string
      Throws:
      IllegalArgumentException - if the specified target type is null.
      See Also:
    • formatXml

      public static String formatXml(String xml)
      Formats the given XML string to its pretty-printed XML format with indents and line breaks for easier reading.
      Parameters:
      xml - the XML string to be formatted
      Returns:
      the formatted XML string
    • formatXml

      public static String formatXml(String xml, Class<?> transferType)
      Formats the given XML string to its pretty-printed XML format with indents and line breaks for easier reading.
      Parameters:
      xml - the XML string to be formatted
      transferType - the type the given XML string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet.
      Returns:
      the formatted XML string
    • formatXml

      public static String formatXml(String xml, com.landawn.abacus.type.Type<?> transferType)
      Formats the given XML string to its pretty-printed XML format with indents and line breaks for easier reading.
      Parameters:
      xml - the XML string to be formatted
      transferType - the type the given XML string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet.
      Returns:
      the formatted XML string
    • formatXml

      public static String formatXml(String xml, XMLSerializationConfig config)
      Formats the given XML string to its pretty-printed XML format with indents and line breaks for easier reading with the specified XMLSerializationConfig.
      Parameters:
      xml - the XML string to be formatted
      config - the XML serialization configuration
      Returns:
      the formatted XML string
    • formatXml

      public static String formatXml(String xml, XMLSerializationConfig config, Class<?> transferType)
      Formats the given XML string to its pretty-printed XML format with indents and line breaks for easier reading with the specified XMLSerializationConfig
      Parameters:
      xml - the XML string to be formatted
      config - the XML serialization configuration
      transferType - the type the given XML string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet.
      Returns:
      the formatted XML string
    • formatXml

      public static String formatXml(String xml, XMLSerializationConfig config, com.landawn.abacus.type.Type<?> transferType)
      Formats the given XML string to its pretty-printed XML format with indents and line breaks for easier reading with the specified XMLSerializationConfig
      Parameters:
      xml - the XML string to be formatted
      config - the XML serialization configuration
      transferType - the type the given XML string will be deserialized to. It can be the Type of Bean/Array/Collection/Map/DataSet.
      Returns:
      the formatted XML string
    • xml2Json

      public static String xml2Json(String xml)
      Converts the given XML string to its JSON string representation.
      Parameters:
      xml - the XML string to be converted to JSON
      Returns:
      the JSON string representation in the given XML
    • xml2Json

      public static String xml2Json(String xml, Class<?> transferType)
      Converts the given XML string to its JSON string representation.
      Parameters:
      xml - the XML string to be converted to JSON
      transferType - the type of intermediate object the given XML string will be deserialized for conversion. It only can be the Type of Bean/Map.
      Returns:
      the JSON string representation in the given XML
    • json2Xml

      public static String json2Xml(String json)
      Converts the given JSON string to its XML string representation.
      Parameters:
      json - the JSON string to be converted to XML
      Returns:
      the XML string representation in the given JSON
    • json2Xml

      public static String json2Xml(String json, Class<?> transferType)
      Converts the given JSON string to its XML string representation.
      Parameters:
      json - the JSON string to be converted to XML
      transferType - the type of intermediate object the given JSON string will be deserialized for conversion. It only can be the Type of Bean/Map.
      Returns:
      the XML string representation in the given JSON
    • forEach

      public static <E extends Exception> void forEach(int startInclusive, int endExclusive, Throwables.Runnable<E> action) throws E
      Executes the provided action for each value in the range defined by startInclusive and endExclusive.
      Type Parameters:
      E - the type of the exception that the action may throw
      Parameters:
      startInclusive - the start value of the range (inclusive)
      endExclusive - the end value of the range (exclusive)
      action - the action to be performed for each value in the range
      Throws:
      E - if the action throws an exception
    • forEach

      public static <E extends Exception> void forEach(int startInclusive, int endExclusive, int step, Throwables.Runnable<E> action) throws IllegalArgumentException, E
      Executes the provided action for each value in the range defined by startInclusive, endExclusive and step.
      Type Parameters:
      E - the type of the exception that the action may throw
      Parameters:
      startInclusive - the start value of the range (inclusive)
      endExclusive - the end value of the range (exclusive)
      step - the increment value for each iteration in the range. It can be positive or negative but not zero.
      action - the action to be performed for each value in the range
      Throws:
      IllegalArgumentException - if the step is zero
      E - if the action throws an exception
    • forEach

      public static <E extends Exception> void forEach(int startInclusive, int endExclusive, Throwables.IntConsumer<E> action) throws E
      Executes the provided action for each value in the range defined by startInclusive and endExclusive.
      Type Parameters:
      E - the type of the exception that the action may throw
      Parameters:
      startInclusive - the start value of the range (inclusive)
      endExclusive - the end value of the range (exclusive)
      action - the action to be performed for each value in the range
      Throws:
      E - if the action throws an exception
    • forEach

      public static <E extends Exception> void forEach(int startInclusive, int endExclusive, int step, Throwables.IntConsumer<E> action) throws E
      Executes the provided action for each value in the range defined by startInclusive, endExclusive and step.
      Type Parameters:
      E - the type of the exception that the action may throw
      Parameters:
      startInclusive - the start value of the range (inclusive)
      endExclusive - the end value of the range (exclusive)
      step - the increment value for each iteration in the range. It can be positive or negative but not zero.
      action - the action to be performed for each value in the range
      Throws:
      IllegalArgumentException - if the step is zero
      E - if the action throws an exception
    • forEach

      public static <T, E extends Exception> void forEach(int startInclusive, int endExclusive, T a, Throwables.IntObjConsumer<? super T,E> action) throws E
      Executes the provided action for each value in the range defined by startInclusive and endExclusive, passing the current index and the provided object a to the action.
      Type Parameters:
      T - the type of the object passed to the action
      E - the type of the exception that the action may throw
      Parameters:
      startInclusive - the start value of the range (inclusive)
      endExclusive - the end value of the range (exclusive)
      a - the object to be passed to the action
      action - the action to be performed for each value in the range
      Throws:
      E - if the action throws an exception
    • forEach

      public static <T, E extends Exception> void forEach(int startInclusive, int endExclusive, int step, T a, Throwables.IntObjConsumer<? super T,E> action) throws E
      Executes the provided action for each value in the range defined by startInclusive, endExclusive and step, passing the current index and the provided object a to the action.
      Type Parameters:
      T - the type of the object passed to the action
      E - the type of the exception that the action may throw
      Parameters:
      startInclusive - the start value of the range (inclusive)
      endExclusive - the end value of the range (exclusive)
      step - the increment value for each iteration in the range. It can be positive or negative but not zero.
      a - the object to be passed to the action
      action - the action to be performed for each value in the range
      Throws:
      IllegalArgumentException - if the step is zero
      E - if the action throws an exception
    • forEach

      public static <T, E extends Exception> void forEach(T[] a, Throwables.Consumer<? super T,E> action) throws E
      Executes the provided action for each element in the given array.
      Type Parameters:
      T - the type of the elements in the array
      E - the type of the exception that the action may throw
      Parameters:
      a - the array whose elements are to be processed
      action - the action to be performed for each element in the array
      Throws:
      E - if the action throws an exception
    • forEach

      public static <T, E extends Exception> void forEach(T[] a, int fromIndex, int toIndex, Throwables.Consumer<? super T,E> action) throws IndexOutOfBoundsException, E
      Executes the provided action for each element within the specified range in the given array.
      Type Parameters:
      T - the type of the elements in the array
      E - the type of the exception that the action may throw
      Parameters:
      a - the array whose elements are to be processed
      fromIndex - the start index of the range (inclusive)
      toIndex - the end index of the range (exclusive)
      action - the action to be performed for each element within the specified range of the array
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
      E - if the action throws an exception
    • forEach

      public static <T, E extends Exception> void forEach(Iterable<? extends T> c, Throwables.Consumer<? super T,E> action) throws E
      Executes the provided action for each element in the given iterable.
      Type Parameters:
      T - the type of the elements in the iterable
      E - the type of the exception that the action may throw
      Parameters:
      c - the iterable whose elements are to be processed
      action - the action to be performed for each element in the iterable
      Throws:
      E - if the action throws an exception
    • forEach

      public static <T, E extends Exception> void forEach(Iterator<? extends T> iter, Throwables.Consumer<? super T,E> action) throws E
      Executes the provided action for each element in the given iterator.
      Type Parameters:
      T - the type of the elements in the iterator
      E - the type of the exception that the action may throw
      Parameters:
      action - the action to be performed for each element in the iterator
      c - the iterator whose elements are to be processed
      Throws:
      E - if the action throws an exception
    • forEach

      public static <T, E extends Exception> void forEach(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.Consumer<? super T,E> action) throws IndexOutOfBoundsException, E
      Executes the provided action for each element within the specified range in the given collection.
      Type Parameters:
      T - the type of the elements in the collection
      E - the type of the exception that the action may throw
      Parameters:
      c - the collection whose elements are to be processed
      fromIndex - the start index of the range (inclusive)
      toIndex - the end index of the range (exclusive)
      action - the action to be performed for each element within the specified range of the collection
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
      E - if the action throws an exception
    • forEach

      public static <K, V, E extends Exception> void forEach(Map<K,V> map, Throwables.Consumer<? super Map.Entry<K,V>,E> action) throws E
      Executes the provided action for each entry in the given map.
      Type Parameters:
      K - the type of the keys in the map
      V - the type of the values in the map
      E - the type of the exception that the action may throw
      Parameters:
      map - the map whose elements are to be processed
      action - the action to be performed for each entry in the given map
      Throws:
      E - if the action throws an exception
    • forEach

      public static <K, V, E extends Exception> void forEach(Map<K,V> map, Throwables.BiConsumer<? super K,? super V,E> action) throws E
      Executes the provided action for each entry in the given map.
      Type Parameters:
      K - the type of the keys in the map
      V - the type of the values in the map
      E - the type of the exception that the action may throw
      Parameters:
      map - the map whose elements are to be processed
      action - the action to be performed for each entry in the given map
      Throws:
      E - if the action throws an exception
    • forEach

      public static <T, E extends Exception> void forEach(Iterable<? extends T> c, Throwables.Consumer<? super T,E> elementConsumer, int processThreadNum)
      Executes the provided elementConsumer for each element in the given iterable by the specified number of threads.
      Type Parameters:
      T - the type of the elements in the iterable
      E - the type of the exception that the elementConsumer may throw
      Parameters:
      c - the iterable whose elements are to be processed
      elementConsumer - the action to be performed for each element in the iterable
      processThreadNum - the number of threads to use for processing
    • forEach

      public static <T, E extends Exception> void forEach(Iterable<? extends T> c, Throwables.Consumer<? super T,E> elementConsumer, int processThreadNum, Executor executor)
      Executes the provided elementConsumer for each element in the given iterable by the specified number of threads and executor.
      Type Parameters:
      T - the type of the elements in the iterable
      E - the type of the exception that the elementConsumer may throw
      Parameters:
      c - the iterable whose elements are to be processed
      elementConsumer - the action to be performed for each element in the iterable
      processThreadNum - the number of threads to use for processing
      executor - the executor to use for processing
    • forEach

      public static <T, E extends Exception> void forEach(Iterator<? extends T> iter, Throwables.Consumer<? super T,E> elementConsumer, int processThreadNum)
      Executes the provided elementConsumer for each element in the given iterator by the specified number of threads.
      Type Parameters:
      T - the type of the elements in the iterator
      E - the type of the exception that the elementConsumer may throw
      Parameters:
      iter - the iterator whose elements are to be processed
      elementConsumer - the action to be performed for each element in the iterator
      processThreadNum - the number of threads to use for processing
    • forEach

      public static <T, E extends Exception> void forEach(Iterator<? extends T> iter, Throwables.Consumer<? super T,E> elementConsumer, int processThreadNum, Executor executor)
      Executes the provided elementConsumer for each element in the given iterator by the specified number of threads and executor.
      Type Parameters:
      T - the type of the elements in the iterator
      E - the type of the exception that the elementConsumer may throw
      Parameters:
      iter - the iterator whose elements are to be processed
      elementConsumer - the action to be performed for each element in the iterator
      processThreadNum - the number of threads to use for processing
      executor - the executor to use for processing
    • forEach

      public static <T, U, E extends Exception, E2 extends Exception> void forEach(T[] a, Throwables.Function<? super T,? extends Iterable<U>,E> flatMapper, Throwables.BiConsumer<? super T,? super U,E2> action) throws E, E2
      Applies the provided flatMapper function to each element in the given array, and then executes the specified action to each resulting element.
      Type Parameters:
      T - the type of the elements in the array
      U - the type of the elements produced by the flatMapper
      E - the type of the exception that the flatMapper may throw
      E2 - the type of the exception that the action may throw
      Parameters:
      a - the array whose elements are to be processed
      flatMapper - the function to apply to each element in the given array, producing an iterable of elements
      action - the action to be performed for each pair of elements from the given array and the resulting iterable
      Throws:
      E - if the flatMapper throws an exception
      E2 - if the action throws an exception
    • forEach

      public static <T, U, E extends Exception, E2 extends Exception> void forEach(Iterable<? extends T> c, Throwables.Function<? super T,? extends Iterable<U>,E> flatMapper, Throwables.BiConsumer<? super T,? super U,E2> action) throws E, E2
      Applies the provided flatMapper function to each element in the given iterable, and then executes the specified action to each resulting element.
      Type Parameters:
      T - the type of the elements in the collection
      U - the type of the elements produced by the flatMapper
      E - the type of the exception that the flatMapper may throw
      E2 - the type of the exception that the action may throw
      Parameters:
      c - the collection whose elements are to be processed
      flatMapper - the function to apply to each element in the given iterable, producing an iterable of elements
      action - the action to be performed for each pair of elements from the given iterable and the resulting iterable
      Throws:
      E - if the flatMapper throws an exception
      E2 - if the action throws an exception
    • forEach

      public static <T, U, E extends Exception, E2 extends Exception> void forEach(Iterator<? extends T> iter, Throwables.Function<? super T,? extends Iterable<U>,E> flatMapper, Throwables.BiConsumer<? super T,? super U,E2> action) throws E, E2
      Applies the provided flatMapper function to each element in the given iterator, and then executes the specified action to each resulting element.
      Type Parameters:
      T - the type of the elements in the iterator
      U - the type of the elements produced by the flatMapper
      E - the type of the exception that the flatMapper may throw
      E2 - the type of the exception that the action may throw
      Parameters:
      iter - the iterator whose elements are to be processed
      flatMapper - the function to apply to each element in the given iterator, producing an iterable of elements
      action - the action to be performed each pair of elements from the given iterator and the resulting iterable
      Throws:
      E - if the flatMapper throws an exception
      E2 - if the action throws an exception
    • forEach

      public static <T, T2, T3, E extends Exception, E2 extends Exception, E3 extends Exception> void forEach(T[] a, Throwables.Function<? super T,? extends Iterable<T2>,E> flatMapper, Throwables.Function<? super T2,? extends Iterable<T3>,E2> flatMapper2, Throwables.TriConsumer<? super T,? super T2,? super T3,E3> action) throws E, E2, E3
      Executes the provided action for each element in the given array after applying the flatMapper and flatMapper2 functions. The flatMapper function maps each element of type T to an Iterable of elements of type T2. The flatMapper2 function maps each element of type T2 to an Iterable of elements of type T3. The action is then performed for each triple of elements from the original array and the resulting iterables.
      Type Parameters:
      T - the type of the elements in the array
      T2 - the type of the elements in the iterable returned by the flatMapper
      T3 - the type of the elements in the iterable returned by the flatMapper2
      E - the type of the exception that the flatMapper may throw
      E2 - the type of the exception that the flatMapper2 may throw
      E3 - the type of the exception that the action may throw
      Parameters:
      a - the array whose elements are to be processed
      flatMapper - the function to apply to each element in given the array to produce an iterable of elements of type T2
      flatMapper2 - the function to apply to each element in the iterable of type T2 to produce an iterable of elements of type T3
      action - the action to be performed for each triple of elements from the given array and the resulting iterables
      Throws:
      E - if the flatMapper throws an exception
      E2 - if the flatMapper2 throws an exception
      E3 - if the action throws an exception
    • forEach

      public static <T, T2, T3, E extends Exception, E2 extends Exception, E3 extends Exception> void forEach(Iterable<? extends T> c, Throwables.Function<? super T,? extends Iterable<T2>,E> flatMapper, Throwables.Function<? super T2,? extends Iterable<T3>,E2> flatMapper2, Throwables.TriConsumer<? super T,? super T2,? super T3,E3> action) throws E, E2, E3
      Executes the provided action for each element in the given iterable after applying the flatMapper and flatMapper2 functions. The flatMapper function maps each element of type T to an Iterable of elements of type T2. The flatMapper2 function maps each element of type T2 to an Iterable of elements of type T3. The action is then performed for each triple of elements from the original iterable and the resulting iterables.
      Type Parameters:
      T - the type of the elements in the collection
      T2 - the type of the elements in the iterable returned by the flatMapper
      T3 - the type of the elements in the iterable returned by the flatMapper2
      E - the type of the exception that the flatMapper may throw
      E2 - the type of the exception that the flatMapper2 may throw
      E3 - the type of the exception that the action may throw
      Parameters:
      c - the collection whose elements are to be processed
      flatMapper - the function to apply to each element in the given iterable to produce an iterable of elements of type T2
      flatMapper2 - the function to apply to each element in the iterable of type T2 to produce an iterable of elements of type T3
      action - the action to be performed for each triple of elements from the given iterable and the resulting iterables
      Throws:
      E - if the flatMapper throws an exception
      E2 - if the flatMapper2 throws an exception
      E3 - if the action throws an exception
    • forEach

      public static <T, T2, T3, E extends Exception, E2 extends Exception, E3 extends Exception> void forEach(Iterator<? extends T> iter, Throwables.Function<? super T,? extends Iterable<T2>,E> flatMapper, Throwables.Function<? super T2,? extends Iterable<T3>,E2> flatMapper2, Throwables.TriConsumer<? super T,? super T2,? super T3,E3> action) throws E, E2, E3
      Executes the provided action for each element in the given iterator after applying the flatMapper and flatMapper2 functions. The flatMapper function maps each element of type T to an Iterable of elements of type T2. The flatMapper2 function maps each element of type T2 to an Iterable of elements of type T3. The action is then performed for each triple of elements from the original iterator and the resulting iterables.
      Type Parameters:
      T - the type of the elements in the iterator
      T2 - the type of the elements in the iterable returned by the flatMapper
      T3 - the type of the elements in the iterable returned by the flatMapper2
      E - the type of the exception that the flatMapper may throw
      E2 - the type of the exception that the flatMapper2 may throw
      E3 - the type of the exception that the action may throw
      Parameters:
      iter - the iterator whose elements are to be processed
      flatMapper - the function to apply to each element in the given iterator to produce an iterable of elements of type T2
      flatMapper2 - the function to apply to each element in the iterable of type T2 to produce an iterable of elements of type T3
      action - the action to be performed for each triple of elements from the given iterator and the resulting iterables
      Throws:
      E - if the flatMapper throws an exception
      E2 - if the flatMapper2 throws an exception
      E3 - if the action throws an exception
    • forEach

      public static <A, B, E extends Exception> void forEach(A[] a, B[] b, Throwables.BiConsumer<? super A,? super B,E> action) throws E
      Executes the provided action for each pair of elements from the given arrays until all elements from the shorter array are processed.
      Type Parameters:
      A - the type of the elements in the first array
      B - the type of the elements in the second array
      E - the type of the exception that the action may throw
      Parameters:
      a - the first array whose elements are to be processed
      b - the second array whose elements are to be processed
      action - the action to be performed for each pair of elements from the arrays
      Throws:
      E - if the action throws an exception
    • forEach

      public static <A, B, E extends Exception> void forEach(Iterable<A> a, Iterable<B> b, Throwables.BiConsumer<? super A,? super B,E> action) throws E
      Executes the provided action for each pair of elements from the given iterables until all elements from the shorter iterable are processed.
      Type Parameters:
      A - the type of the elements in the first iterable
      B - the type of the elements in the second iterable
      E - the type of the exception that the action may throw
      Parameters:
      a - the first iterable whose elements are to be processed
      b - the second iterable whose elements are to be processed
      action - the action to be performed for each pair of elements from the iterables
      Throws:
      E - if the action throws an exception
    • forEach

      public static <A, B, E extends Exception> void forEach(Iterator<A> a, Iterator<B> b, Throwables.BiConsumer<? super A,? super B,E> action) throws E
      Executes the provided action for each pair of elements from the given iterators until all elements from the shorter iterator are processed.
      Type Parameters:
      A - the type of the elements in the first iterator
      B - the type of the elements in the second iterator
      E - the type of the exception that the action may throw
      Parameters:
      a - the first iterator whose elements are to be processed
      b - the second iterator whose elements are to be processed
      action - the action to be performed for each pair of elements from the iterators
      Throws:
      E - if the action throws an exception
    • forEach

      public static <A, B, C, E extends Exception> void forEach(A[] a, B[] b, C[] c, Throwables.TriConsumer<? super A,? super B,? super C,E> action) throws E
      Executes the provided action for each triple of elements from the given arrays until all elements from the shortest array are processed.
      Type Parameters:
      A - the type of the elements in the first array
      B - the type of the elements in the second array
      E - the type of the exception that the action may throw
      B - the type of the elements in the third array
      Parameters:
      a - the first array whose elements are to be processed
      b - the second array whose elements are to be processed
      c - the third array whose elements are to be processed
      action - the action to be performed for each triple of elements from the arrays
      Throws:
      E - if the action throws an exception
    • forEach

      public static <A, B, C, E extends Exception> void forEach(Iterable<A> a, Iterable<B> b, Iterable<C> c, Throwables.TriConsumer<? super A,? super B,? super C,E> action) throws E
      Executes the provided action for each triple of elements from the given iterables until all elements from the shortest iterable are processed.
      Type Parameters:
      A - the type of the elements in the first iterable
      B - the type of the elements in the second iterable
      C - the type of the elements in the third iterable
      E - the type of the exception that the action may throw
      Parameters:
      a - the first iterable whose elements are to be processed
      b - the second iterable whose elements are to be processed
      c - the third iterable whose elements are to be processed
      action - the action to be performed for each triple of elements from the iterables
      Throws:
      E - if the action throws an exception
    • forEach

      public static <A, B, C, E extends Exception> void forEach(Iterator<A> a, Iterator<B> b, Iterator<C> c, Throwables.TriConsumer<? super A,? super B,? super C,E> action) throws E
      Executes the provided action for each triple of elements from the given iterators until all elements from the shortest iterator are processed.
      Type Parameters:
      A - the type of the elements in the first iterator
      B - the type of the elements in the second iterator
      C - the type of the elements in the third iterator
      E - the type of the exception that the action may throw
      Parameters:
      a - the first iterator whose elements are to be processed
      b - the second iterator whose elements are to be processed
      c - the third iterator whose elements are to be processed
      action - the action to be performed for each triple of elements from the iterators
      Throws:
      E - if the action throws an exception
    • forEach

      public static <A, B, E extends Exception> void forEach(A[] a, B[] b, A valueForNoneA, B valueForNoneB, Throwables.BiConsumer<? super A,? super B,E> action) throws E
      Executes the provided action for each pair of elements from the given arrays until all elements from the longer array are processed.
      Type Parameters:
      A - the type of the elements in the first array
      B - the type of the elements in the second array
      E - the type of the exception that the action may throw
      Parameters:
      a - the first array whose elements are to be processed
      b - the second array whose elements are to be processed
      valueForNoneA - the value to be used if the first array is shorter than the second array
      valueForNoneB - the value to be used if the second array is shorter than the first array
      action - the action to be performed for each pair of elements from the arrays
      Throws:
      E - if the action throws an exception
    • forEach

      public static <A, B, E extends Exception> void forEach(Iterable<A> a, Iterable<B> b, A valueForNoneA, B valueForNoneB, Throwables.BiConsumer<? super A,? super B,E> action) throws E
      Executes the provided action for each pair of elements from the given iterables until all elements from the longer iterable are processed.
      Type Parameters:
      A - the type of the elements in the first iterable
      B - the type of the elements in the second iterable
      E - the type of the exception that the action may throw
      Parameters:
      a - the first iterable whose elements are to be processed
      b - the second iterable whose elements are to be processed
      valueForNoneA - the value to be used if the first iterable is shorter than the second iterable
      valueForNoneB - the value to be used if the second iterable is shorter than the first iterable
      action - the action to be performed for each pair of elements from the iterables
      Throws:
      E - if the action throws an exception
    • forEach

      public static <A, B, E extends Exception> void forEach(Iterator<A> a, Iterator<B> b, A valueForNoneA, B valueForNoneB, Throwables.BiConsumer<? super A,? super B,E> action) throws E
      Executes the provided action for each pair of elements from the given iterators until all elements from the longer iterator are processed.
      Type Parameters:
      A - the type of the elements in the first iterator
      B - the type of the elements in the second iterator
      E - the type of the exception that the action may throw
      Parameters:
      a - the first iterator whose elements are to be processed
      b - the second iterator whose elements are to be processed
      valueForNoneA - the value to be used if the first iterator is shorter than the second iterator
      valueForNoneB - the value to be used if the second iterator is shorter than the first iterator
      action - the action to be performed for each pair of elements from the iterators
      Throws:
      E - if the action throws an exception
    • forEach

      public static <A, B, C, E extends Exception> void forEach(A[] a, B[] b, C[] c, A valueForNoneA, B valueForNoneB, C valueForNoneC, Throwables.TriConsumer<? super A,? super B,? super C,E> action) throws E
      Executes the provided action for each triple of elements from the given arrays until all elements from the longest array are processed.
      Type Parameters:
      A - the type of the elements in the first array
      B - the type of the elements in the second array
      C - the type of the elements in the third array
      E - the type of the exception that the action may throw
      Parameters:
      a - the first array whose elements are to be processed
      b - the second array whose elements are to be processed
      c - the third array whose elements are to be processed
      valueForNoneA - the value to be used if the first array is shorter than the second and third arrays
      valueForNoneB - the value to be used if the second array is shorter than the first and third arrays
      valueForNoneC - the value to be used if the third array is shorter than the first and second arrays
      action - the action to be performed for each triple of elements from the arrays
      Throws:
      E - if the action throws an exception
    • forEach

      public static <A, B, C, E extends Exception> void forEach(Iterable<A> a, Iterable<B> b, Iterable<C> c, A valueForNoneA, B valueForNoneB, C valueForNoneC, Throwables.TriConsumer<? super A,? super B,? super C,E> action) throws E
      Executes the provided action for each triple of elements from the given iterables until all elements from the longest iterable are processed.
      Type Parameters:
      A - the type of the elements in the first iterable
      B - the type of the elements in the second iterable
      C - the type of the elements in the third iterable
      E - the type of the exception that the action may throw
      Parameters:
      a - the first iterable whose elements are to be processed
      b - the second iterable whose elements are to be processed
      c - the third iterable whose elements are to be processed
      valueForNoneA - the value to be used if the first iterable is shorter than the second and third iterables
      valueForNoneB - the value to be used if the second iterable is shorter than the first and third iterables
      valueForNoneC - the value to be used if the third iterable is shorter than the first and second iterables
      action - the action to be performed for each triple of elements from the iterables
      Throws:
      E - if the action throws an exception
    • forEach

      public static <A, B, C, E extends Exception> void forEach(Iterator<A> a, Iterator<B> b, Iterator<C> c, A valueForNoneA, B valueForNoneB, C valueForNoneC, Throwables.TriConsumer<? super A,? super B,? super C,E> action) throws E
      Executes the provided action for each triple of elements from the given iterators until all elements from the longest iterator are processed.
      Type Parameters:
      A - the type of the elements in the first iterator
      B - the type of the elements in the second iterator
      C - the type of the elements in the third iterator
      E - the type of the exception that the action may throw
      Parameters:
      a - the first iterator whose elements are to be processed
      b - the second iterator whose elements are to be processed
      c - the third iterator whose elements are to be processed
      valueForNoneA - the value to be used if the first iterator is shorter than the second and third iterators
      valueForNoneB - the value to be used if the second iterator is shorter than the first and third iterators
      valueForNoneC - the value to be used if the third iterator is shorter than the first and second iterators
      action - the action to be performed for each triple of elements from the iterators
      Throws:
      E - if the action throws an exception
    • forEachNonNull

      public static <T, E extends Exception> void forEachNonNull(T[] a, Throwables.Consumer<? super T,E> action) throws E
      Executes the provided action for each non-null element in the given array. The null elements are ignored.
      Type Parameters:
      T - the type of the elements in the array
      E - the type of the exception that the action may throw
      Parameters:
      a - the array whose non-null elements are to be processed
      action - the action to be performed for each non-null element in the array
      Throws:
      E - if the action throws an exception
    • forEachNonNull

      public static <T, E extends Exception> void forEachNonNull(Iterable<? extends T> c, Throwables.Consumer<? super T,E> action) throws E
      Executes the provided action for each non-null element in the given iterable. The null elements are ignored.
      Type Parameters:
      T - the type of the elements in the collection
      E - the type of the exception that the action may throw
      Parameters:
      c - the collection whose non-null elements are to be processed
      action - the action to be performed for each non-null element in the collection
      Throws:
      E - if the action throws an exception
    • forEachNonNull

      public static <T, E extends Exception> void forEachNonNull(Iterator<? extends T> iter, Throwables.Consumer<? super T,E> action) throws E
      Executes the provided action for each non-null element in the given iterator. The null elements are ignored.
      Type Parameters:
      T - the type of the elements in the iterator
      E - the type of the exception that the action may throw
      Parameters:
      iter - the iterator whose non-null elements are to be processed
      action - the action to be performed for each non-null element in the iterator
      Throws:
      E - if the action throws an exception
    • forEachNonNull

      public static <T, U, E extends Exception, E2 extends Exception> void forEachNonNull(T[] a, Throwables.Function<? super T,? extends Iterable<U>,E> flatMapper, Throwables.BiConsumer<? super T,? super U,E2> action) throws E, E2
      Applies the provided flatMapper function to each non-null element in the given array, and then executes the specified action to each non-null resulting element.
      Type Parameters:
      T - the type of the elements in the given array
      U - the type of the elements produced by the flatMapper
      E - the type of the exception that the flatMapper may throw
      E2 - the type of the exception that the action may throw
      Parameters:
      a - the array whose elements are to be processed
      flatMapper - the function to apply to each non-null element in the given array, producing an iterable of elements
      action - the action to be performed for each pair of non-null elements from the given array and the resulting iterable
      Throws:
      E - if the flatMapper throws an exception
      E2 - if the action throws an exception
    • forEachNonNull

      public static <T, U, E extends Exception, E2 extends Exception> void forEachNonNull(Iterable<? extends T> c, Throwables.Function<? super T,? extends Iterable<U>,E> flatMapper, Throwables.BiConsumer<? super T,? super U,E2> action) throws E, E2
      Applies the provided flatMapper function to each non-null element in the given iterable, and then executes the specified action to each non-null resulting element.
      Type Parameters:
      T - the type of the elements in the given iterable
      U - the type of the elements produced by the flatMapper
      E - the type of the exception that the flatMapper may throw
      E2 - the type of the exception that the action may throw
      Parameters:
      c - the collection whose elements are to be processed
      flatMapper - the function to apply to each non-null element in the given iterable, producing an iterable of elements
      action - the action to be performed for pair of non-null elements from the given iterable and the resulting iterable
      Throws:
      E - if the flatMapper throws an exception
      E2 - if the action throws an exception
    • forEachNonNull

      public static <T, U, E extends Exception, E2 extends Exception> void forEachNonNull(Iterator<? extends T> iter, Throwables.Function<? super T,? extends Iterable<U>,E> flatMapper, Throwables.BiConsumer<? super T,? super U,E2> action) throws E, E2
      Applies the provided flatMapper function to each non-null element in the given iterator, and then executes the specified action to each non-null resulting element.
      Type Parameters:
      T - the type of the elements in the given iterator
      U - the type of the elements produced by the flatMapper
      E - the type of the exception that the flatMapper may throw
      E2 - the type of the exception that the action may throw
      Parameters:
      iter - the iterator whose elements are to be processed
      flatMapper - the function to apply to each non-null element in the given iterator, producing an iterable of elements
      action - the action to be performed for pair of non-null elements from the given iterator and the resulting iterable
      Throws:
      E - if the flatMapper throws an exception
      E2 - if the action throws an exception
    • forEachNonNull

      public static <T, T2, T3, E extends Exception, E2 extends Exception, E3 extends Exception> void forEachNonNull(T[] a, Throwables.Function<? super T,? extends Iterable<T2>,E> flatMapper, Throwables.Function<? super T2,? extends Iterable<T3>,E2> flatMapper2, Throwables.TriConsumer<? super T,? super T2,? super T3,E3> action) throws E, E2, E3
      Executes the provided action for each non-null element in the given array after applying the flatMapper and flatMapper2 functions. The flatMapper function maps each non-null element of type T to an Iterable of elements of type T2. The flatMapper2 function maps each non-null element of type T2 to an Iterable of elements of type T3. The action is then performed for each triple of non-null elements from the original array and the resulting iterables.
      Type Parameters:
      T - the type of the elements in the given array
      T2 - the type of the elements in the iterable returned by the flatMapper
      T3 - the type of the elements in the iterable returned by the flatMapper2
      E - the type of the exception that the flatMapper may throw
      E2 - the type of the exception that the flatMapper2 may throw
      E3 - the type of the exception that the action may throw
      Parameters:
      a - the array whose non-null elements are to be processed
      flatMapper - the function to apply to each non-null element in the given array to produce an iterable of elements of type T2
      flatMapper2 - the function to apply to each non-null element in the iterable of type T2 to produce an iterable of elements of type T3
      action - the action to be performed for each triple of non-null elements from the given array and the resulting iterables
      Throws:
      E - if the flatMapper throws an exception
      E2 - if the flatMapper2 throws an exception
      E3 - if the action throws an exception
    • forEachNonNull

      public static <T, T2, T3, E extends Exception, E2 extends Exception, E3 extends Exception> void forEachNonNull(Iterable<? extends T> c, Throwables.Function<? super T,? extends Iterable<T2>,E> flatMapper, Throwables.Function<? super T2,? extends Iterable<T3>,E2> flatMapper2, Throwables.TriConsumer<? super T,? super T2,? super T3,E3> action) throws E, E2, E3
      Executes the provided action for each non-null element in the given iterable after applying the flatMapper and flatMapper2 functions. The flatMapper function maps each non-null element of type T to an Iterable of elements of type T2. The flatMapper2 function maps each non-null element of type T2 to an Iterable of elements of type T3. The action is then performed for each triple of non-null elements from the original iterable and the resulting iterables.
      Type Parameters:
      T - the type of the elements in the given iterable
      T2 - the type of the elements in the iterable returned by the flatMapper
      T3 - the type of the elements in the iterable returned by the flatMapper2
      E - the type of the exception that the flatMapper may throw
      E2 - the type of the exception that the flatMapper2 may throw
      E3 - the type of the exception that the action may throw
      Parameters:
      c - the iterable whose non-null elements are to be processed
      flatMapper - the function to apply to each non-null element in the given iterable to produce an iterable of elements of type T2
      flatMapper2 - the function to apply to each non-null element in the given iterable of type T2 to produce an iterable of elements of type T3
      action - the action to be performed for each triple of non-null elements from the given iterable and the resulting iterables
      Throws:
      E - if the flatMapper throws an exception
      E2 - if the flatMapper2 throws an exception
      E3 - if the action throws an exception
    • forEachNonNull

      public static <T, T2, T3, E extends Exception, E2 extends Exception, E3 extends Exception> void forEachNonNull(Iterator<? extends T> iter, Throwables.Function<? super T,? extends Iterable<T2>,E> flatMapper, Throwables.Function<? super T2,? extends Iterable<T3>,E2> flatMapper2, Throwables.TriConsumer<? super T,? super T2,? super T3,E3> action) throws E, E2, E3
      Executes the provided action for each non-null element in the given iterator after applying the flatMapper and flatMapper2 functions. The flatMapper function maps each non-null element of type T to an Iterable of elements of type T2. The flatMapper2 function maps each non-null element of type T2 to an Iterable of elements of type T3. The action is then performed for each triple of non-null elements from the original iterator and the resulting iterables.
      Type Parameters:
      T - the type of the elements in the given iterator
      T2 - the type of the elements produced by the flatMapper
      T3 - the type of the elements produced by the flatMapper2
      E - the type of the exception that the flatMapper may throw
      E2 - the type of the exception that the flatMapper2 may throw
      E3 - the type of the exception that the action may throw
      Parameters:
      iter - the iterator whose non-null elements are to be processed
      flatMapper - the function to apply to each non-null element in the given iterator to produce an iterable of elements of type T2
      flatMapper2 - the function to apply to each non-null element in the iterable of type T2 to produce an iterable of elements of type T3
      action - the action to be performed for each triple of non-null elements from the given iterator and the resulting iterables
      Throws:
      E - if the flatMapper throws an exception
      E2 - if the flatMapper2 throws an exception
      E3 - if the action throws an exception
    • forEachIndexed

      public static <T, E extends Exception> void forEachIndexed(T[] a, Throwables.IntObjConsumer<? super T,E> action) throws E
      Executes the provided action for each element in the given array, passing the index and the element to the action.
      Type Parameters:
      T - the type of the elements in the array
      E - the type of the exception that the action may throw
      Parameters:
      a - the array whose elements are to be processed
      action - the action to be performed for each element, which takes the index and the element as parameters
      Throws:
      E - if the action throws an exception
    • forEachIndexed

      public static <T, E extends Exception> void forEachIndexed(T[] a, int fromIndex, int toIndex, Throwables.IntObjConsumer<? super T,E> action) throws IndexOutOfBoundsException, E
      Executes the provided action for each element within the specified range in the given array, passing the index and the element to the action. If fromIndex is greater than toIndex, the elements are processed from back to front.
      Type Parameters:
      T - the type of the elements in the array
      E - the type of the exception that the action may throw
      Parameters:
      a - the array whose elements are to be processed
      fromIndex - the starting index (inclusive) of the range to be processed
      toIndex - the ending index (exclusive) of the range to be processed
      action - the action to be performed for each element within the specified range, which takes the index and the element as parameters
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
      E - if the action throws an exception
    • forEachIndexed

      public static <T, E extends Exception> void forEachIndexed(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.IntObjConsumer<? super T,E> action) throws IndexOutOfBoundsException, E
      Executes the provided action for each element within the specified range in the given collection, passing the index and the element to the action. If fromIndex is greater than toIndex, the elements are processed from back to front.
      Type Parameters:
      T - the type of the elements in the collection
      E - the type of the exception that the action may throw
      Parameters:
      c - the collection whose elements are to be processed
      fromIndex - the starting index (inclusive) of the range to be processed
      toIndex - the ending index (exclusive) of the range to be processed
      action - the action to be performed for each element within the specified range, which takes the index and the element as parameters
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
      E - if the action throws an exception
    • forEachIndexed

      public static <T, E extends Exception> void forEachIndexed(Iterable<? extends T> c, Throwables.IntObjConsumer<? super T,E> action) throws E
      Executes the provided action for each element in the given iterable, passing the index and the element to the action.
      Type Parameters:
      T - the type of the elements in the iterable
      E - the type of the exception that the action may throw
      Parameters:
      c - the collection whose elements are to be processed
      action - the action to be performed for each element, which takes the index and the element as parameters
      Throws:
      E - if the action throws an exception
    • forEachIndexed

      public static <T, E extends Exception> void forEachIndexed(Iterator<? extends T> iter, Throwables.IntObjConsumer<? super T,E> action) throws E
      Executes the provided action for each element in the given iterable, passing the index and the element to the action.
      Type Parameters:
      T - the type of the elements in the iterable
      E - the type of the exception that the action may throw
      Parameters:
      action - the action to be performed for each element, which takes the index and the element as parameters
      c - the collection whose elements are to be processed
      Throws:
      E - if the action throws an exception
    • forEachIndexed

      public static <K, V, E extends Exception> void forEachIndexed(Map<K,V> map, Throwables.IntObjConsumer<? super Map.Entry<K,V>,E> action) throws E
      Executes the provided action for each entry in the given map, passing the index and the entry to the action.
      Type Parameters:
      K - the type of the keys in the map
      V - the type of the values in the map
      E - the type of the exception that the action may throw
      Parameters:
      map - the map whose entries are to be processed
      action - the action to be performed for each entry, which takes the index and the entry as parameters
      Throws:
      E - if the action throws an exception
    • forEachIndexed

      public static <K, V, E extends Exception> void forEachIndexed(Map<K,V> map, Throwables.IntBiObjConsumer<? super K,? super V,E> action) throws E
      Executes the provided action for each entry in the given map, passing the index, the key, and the value to the action.
      Type Parameters:
      K - the type of the keys in the map
      V - the type of the values in the map
      E - the type of the exception that the action may throw
      Parameters:
      map - the map whose entries are to be processed
      action - the action to be performed for each entry, which takes the index, the key, and the value as parameters
      Throws:
      E - if the action throws an exception
    • forEachIndexed

      public static <T, E extends Exception> void forEachIndexed(Iterable<? extends T> c, Throwables.IntObjConsumer<? super T,E> action, int processThreadNum)
      Executes the provided action for each element in the given Iterable, passing the index and the element to the action, by the specified number of threads.
      Type Parameters:
      T - the type of the elements in the Iterable
      E - the type of the exception that the consumer may throw
      Parameters:
      c - the Iterable whose elements are to be processed
      action - the consumer to be performed for each element, which takes the index and the element as parameters
      processThreadNum - the number of threads to use for processing
      Throws:
      E - if the consumer throws an exception
    • forEachIndexed

      public static <T, E extends Exception> void forEachIndexed(Iterable<? extends T> c, Throwables.IntObjConsumer<? super T,E> action, int processThreadNum, Executor executor)
      Executes the provided action for each element in the given Iterable, passing the index and the element to the action, by the specified number of threads and executor.
      Type Parameters:
      T - the type of the elements in the Iterable
      E - the type of the exception that the consumer may throw
      Parameters:
      c - the Iterable whose elements are to be processed
      action - the consumer to be performed for each element, which takes the index and the element as parameters
      processThreadNum - the number of threads to use for processing
      executor - the executor to use for processing
      Throws:
      E - if the consumer throws an exception
    • forEachIndexed

      public static <T, E extends Exception> void forEachIndexed(Iterator<? extends T> iter, Throwables.IntObjConsumer<? super T,E> elementConsumer, int processThreadNum)
      Executes the provided action for each element in the given Iterator, passing the index and the element to the action, by the specified number of threads.
      Type Parameters:
      T - the type of the elements in the Iterator
      E - the type of the exception that the consumer may throw
      Parameters:
      iter - the Iterator whose elements are to be processed
      processThreadNum - the number of threads to use for processing
      action - the consumer to be performed for each element, which takes the index and the element as parameters
      Throws:
      E - if the consumer throws an exception
    • forEachIndexed

      public static <T, E extends Exception> void forEachIndexed(Iterator<? extends T> iter, Throwables.IntObjConsumer<? super T,E> elementConsumer, int processThreadNum, Executor executor) throws IllegalArgumentException
      Executes the provided action for each element in the given Iterator, passing the index and the element to the action, by the specified number of threads and executor.
      Type Parameters:
      T - the type of the elements in the Iterator
      E - the type of the exception that the consumer may throw
      Parameters:
      iter - the Iterator whose elements are to be processed
      processThreadNum - the number of threads to use for processing
      executor - the executor to use for processing
      action - the consumer to be performed for each element, which takes the index and the element as parameters
      Throws:
      E - if the consumer throws an exception
      IllegalArgumentException
    • forEachPair

      public static <T, E extends Exception> void forEachPair(T[] a, Throwables.BiConsumer<? super T,? super T,E> action) throws E
      Executes the provided action for each pair of consecutive elements in the given array. For the last non-paired element, the action is performed with the last element and null.
      Type Parameters:
      T - the type of the elements in the array
      E - the type of the exception that the action may throw
      Parameters:
      a - the array whose elements are to be processed
      action - the action to be performed for each pair of elements
      Throws:
      E - if the action throws an exception
    • forEachPair

      public static <T, E extends Exception> void forEachPair(T[] a, int increment, Throwables.BiConsumer<? super T,? super T,E> action) throws E
      Executes the provided action for each pair of consecutive elements in the given array, with the specified increment between pairs. For the last non-paired element, the action is performed with the last element and null.
      Type Parameters:
      T - the type of the elements in the array
      E - the type of the exception that the action may throw
      Parameters:
      a - the array whose elements are to be processed
      increment - the increment between pairs of elements
      action - the action to be performed for each pair of elements
      Throws:
      E - if the action throws an exception
    • forEachPair

      public static <T, E extends Exception> void forEachPair(Iterable<? extends T> c, Throwables.BiConsumer<? super T,? super T,E> action) throws E
      Executes the provided action for each pair of consecutive elements in the given iterable. For the last non-paired element, the action is performed with the last element and null.
      Type Parameters:
      T - the type of the elements in the iterable
      E - the type of the exception that the action may throw
      Parameters:
      c - the iterable whose elements are to be processed
      action - the action to be performed for each pair of elements
      Throws:
      E - if the action throws an exception
    • forEachPair

      public static <T, E extends Exception> void forEachPair(Iterable<? extends T> c, int increment, Throwables.BiConsumer<? super T,? super T,E> action) throws E
      Executes the provided action for each pair of consecutive elements in the given iterable, with the specified increment between pairs. For the last non-paired element, the action is performed with the last element and null.
      Type Parameters:
      T - the type of the elements in the iterable
      E - the type of the exception that the action may throw
      Parameters:
      c - the iterable whose elements are to be processed
      increment - the increment between pairs of elements
      action - the action to be performed for each pair of elements
      Throws:
      E - if the action throws an exception
    • forEachPair

      public static <T, E extends Exception> void forEachPair(Iterator<? extends T> iter, Throwables.BiConsumer<? super T,? super T,E> action) throws E
      Executes the provided action for each pair of consecutive elements in the given iterator. For the last non-paired element, the action is performed with the last element and null.
      Type Parameters:
      T - the type of the elements in the iterator
      E - the type of the exception that the action may throw
      Parameters:
      iter - the iterator whose elements are to be processed
      action - the action to be performed for each pair of elements
      Throws:
      E - if the action throws an exception
    • forEachPair

      public static <T, E extends Exception> void forEachPair(Iterator<? extends T> iter, int increment, Throwables.BiConsumer<? super T,? super T,E> action) throws E
      Executes the provided action for each pair of consecutive elements in the given iterator, with the specified increment between pairs. For the last non-paired element, the action is performed with the last element and null.
      Type Parameters:
      T - the type of the elements in the iterator
      E - the type of the exception that the action may throw
      Parameters:
      iter - the iterator whose elements are to be processed
      increment - the increment between pairs of elements
      action - the action to be performed for each pair of elements
      Throws:
      E - if the action throws an exception
    • forEachTriple

      public static <T, E extends Exception> void forEachTriple(T[] a, Throwables.TriConsumer<? super T,? super T,? super T,E> action) throws E
      Executes the provided action for each triple of consecutive elements in the given array. For the last two non-tripled elements, the action is performed with the last two elements and null.
      Type Parameters:
      T - the type of the elements in the array
      E - the type of the exception that the action may throw
      Parameters:
      a - the array whose elements are to be processed
      action - the action to be performed for each triple of elements
      Throws:
      E - if the action throws an exception
    • forEachTriple

      public static <T, E extends Exception> void forEachTriple(T[] a, int increment, Throwables.TriConsumer<? super T,? super T,? super T,E> action) throws E
      Executes the provided action for each triple of consecutive elements in the given array, with the specified increment between triples. For the last two non-tripled elements, the action is performed with the last two elements and null.
      Type Parameters:
      T - the type of the elements in the array
      E - the type of the exception that the action may throw
      Parameters:
      a - the array whose elements are to be processed
      increment - the increment between triples of elements
      action - the action to be performed for each triple of elements
      Throws:
      E - if the action throws an exception
    • forEachTriple

      public static <T, E extends Exception> void forEachTriple(Iterable<? extends T> c, Throwables.TriConsumer<? super T,? super T,? super T,E> action) throws E
      Executes the provided action for each triple of consecutive elements in the given iterable. For the last two non-tripled elements, the action is performed with the last two elements and null.
      Type Parameters:
      T - the type of the elements in the iterable
      E - the type of the exception that the action may throw
      Parameters:
      c - the iterable whose elements are to be processed
      action - the action to be performed for each triple of elements
      Throws:
      E - if the action throws an exception
    • forEachTriple

      public static <T, E extends Exception> void forEachTriple(Iterable<? extends T> c, int increment, Throwables.TriConsumer<? super T,? super T,? super T,E> action) throws E
      Executes the provided action for each triple of consecutive elements in the given iterable, with the specified increment between triples. For the last two non-tripled elements, the action is performed with the last two elements and null.
      Type Parameters:
      T - the type of the elements in the iterable
      E - the type of the exception that the action may throw
      Parameters:
      c - the iterable whose elements are to be processed
      increment - the increment between triples of elements
      action - the action to be performed for each triple of elements
      Throws:
      E - if the action throws an exception
    • forEachTriple

      public static <T, E extends Exception> void forEachTriple(Iterator<? extends T> iter, Throwables.TriConsumer<? super T,? super T,? super T,E> action) throws E
      Executes the provided action for each triple of consecutive elements in the given iterator. For the last two non-tripled elements, the action is performed with the last two elements and null.
      Type Parameters:
      T - the type of the elements in the iterator
      E - the type of the exception that the action may throw
      Parameters:
      iter - the iterator whose elements are to be processed
      action - the action to be performed for each triple of elements
      Throws:
      E - if the action throws an exception
    • forEachTriple

      public static <T, E extends Exception> void forEachTriple(Iterator<? extends T> iter, int increment, Throwables.TriConsumer<? super T,? super T,? super T,E> action) throws E
      Executes the provided action for each triple of consecutive elements in the given iterator, with the specified increment between triples. For the last two non-tripled elements, the action is performed with the last two elements and null.
      Type Parameters:
      T - the type of the elements in the iterator
      E - the type of the exception that the action may throw
      Parameters:
      iter - the iterator whose elements are to be processed
      increment - the increment between triples of elements
      action - the action to be performed for each triple of elements
      Throws:
      E - if the action throws an exception
    • execute

      public static void execute(Throwables.Runnable<? extends Exception> cmd, int retryTimes, long retryIntervallInMillis, Predicate<? super Exception> retryCondition)
      Executes the provided command with the specified retry logic in case of failure.
      Parameters:
      cmd - the command to be executed
      retryTimes - the number of times to retry the command if it fails
      retryIntervallInMillis - the interval in milliseconds between retries
      retryCondition - The condition to be checked after each execution failure to decide whether to retry or not
      Throws:
      RuntimeException - if the command execution fails and no more retries are allowed.
      See Also:
    • execute

      public static <R> R execute(Callable<R> cmd, int retryTimes, long retryIntervallInMillis, BiPredicate<? super R,? super Exception> retryCondition)
      Executes the provided command with the specified retry logic in case of failure.
      Parameters:
      cmd - the command to be executed
      retryTimes - the number of times to retry the command if it fails
      retryIntervallInMillis - the interval in milliseconds between retries
      retryCondition - The condition to be checked after each execution failure to decide whether to retry or not
      Returns:
      The result returned by the Callable task.
      Throws:
      RuntimeException - if the command execution fails and no more retries are allowed.
      See Also:
    • asyncExecute

      public static ContinuableFuture<Void> asyncExecute(Throwables.Runnable<? extends Exception> command)
      Executes the provided command asynchronously.
      Parameters:
      command - the command to be executed
      Returns:
      a ContinuableFuture representing the pending completion of the task
      See Also:
    • asyncExecute

      public static ContinuableFuture<Void> asyncExecute(Throwables.Runnable<? extends Exception> command, Executor executor)
      Executes the provided command asynchronously by the specified executor.
      Parameters:
      command - the command to be executed
      executor - the executor to use for processing
      Returns:
      a ContinuableFuture representing the pending completion of the task
      See Also:
    • asyncExecute

      public static ContinuableFuture<Void> asyncExecute(Throwables.Runnable<? extends Exception> command, long delayInMillis)
      Executes the provided command asynchronously with the specified delay.
      Parameters:
      command - the command to be executed
      delayInMillis - The delay before the command is executed, in milliseconds.
      Returns:
      a ContinuableFuture representing the pending completion of the task
      See Also:
    • asyncExecute

      public static <R> ContinuableFuture<R> asyncExecute(Callable<R> command)
      Executes the provided command asynchronously.
      Parameters:
      command - the command to be executed
      Returns:
      a ContinuableFuture representing the pending completion of the task
      See Also:
    • asyncExecute

      public static <R> ContinuableFuture<R> asyncExecute(Callable<R> command, Executor executor)
      Executes the provided command asynchronously by the specified executor.
      Parameters:
      command - the command to be executed
      executor - the executor to use for processing
      Returns:
      a ContinuableFuture representing the pending completion of the task
      See Also:
    • asyncExecute

      public static <R> ContinuableFuture<R> asyncExecute(Callable<R> command, long delayInMillis)
      Executes the provided command asynchronously with the specified delay.
      Parameters:
      command - the command to be executed
      delayInMillis - The delay before the command is executed, in milliseconds.
      Returns:
      a ContinuableFuture representing the pending completion of the task
      See Also:
    • asyncExecute

      public static ContinuableFuture<Void> asyncExecute(Throwables.Runnable<? extends Exception> cmd, int retryTimes, long retryIntervallInMillisInMillis, Predicate<? super Exception> retryCondition)
      Executes the provided command asynchronously with the specified retry logic in case of failure.
      Parameters:
      cmd - the command to be executed
      retryTimes - the number of times to retry the command if it fails
      retryCondition - The condition to be checked after each execution failure to decide whether to retry or not
      retryIntervallInMillis - the interval in milliseconds between retries
      See Also:
    • asyncExecute

      public static <R> ContinuableFuture<R> asyncExecute(Callable<R> cmd, int retryTimes, long retryIntervallInMillisInMillis, BiPredicate<? super R,? super Exception> retryCondition)
      Executes the provided command asynchronously with the specified retry logic in case of failure.
      Parameters:
      cmd - the command to be executed
      retryTimes - the number of times to retry the command if it fails
      retryCondition - The condition to be checked after each execution failure to decide whether to retry or not
      retryIntervallInMillis - the interval in milliseconds between retries
      See Also:
    • asyncExecute

      public static List<ContinuableFuture<Void>> asyncExecute(List<? extends Throwables.Runnable<? extends Exception>> commands)
      Executes the provided a list of commands asynchronously.
      Parameters:
      commands - the list of commands to be executed
      Returns:
      a list of ContinuableFuture objects representing the pending completion of each command
      See Also:
    • asyncExecute

      public static List<ContinuableFuture<Void>> asyncExecute(List<? extends Throwables.Runnable<? extends Exception>> commands, Executor executor)
      Executes the provided a list of commands asynchronously by the specified executor.
      Parameters:
      commands - the list of commands to be executed
      executor - the executor to use for processing
      Returns:
      a list of ContinuableFuture objects representing the pending completion of each command
      See Also:
    • asyncExecute

      public static <R> List<ContinuableFuture<R>> asyncExecute(Collection<? extends Callable<R>> commands)
      Executes the provided a collection of commands asynchronously.
      Parameters:
      commands - the collection of commands to be executed
      Returns:
      a list of ContinuableFuture objects representing the pending completion of each command
      See Also:
    • asyncExecute

      public static <R> List<ContinuableFuture<R>> asyncExecute(Collection<? extends Callable<R>> commands, Executor executor)
      Executes the provided a collection of commands asynchronously by the specified executor.
      Parameters:
      commands - the collection of commands to be executed
      executor - the executor to use for processing
      Returns:
      a list of ContinuableFuture objects representing the pending completion of each command
      See Also:
    • asynRun

      public static ObjIterator<Void> asynRun(Collection<? extends Throwables.Runnable<? extends Exception>> commands)
      Executes the specified commands/tasks asynchronously and immediately returns an iterator for iterating the result lazily. The first element will be the result of the command/task which is completed first.
      If an error occurs in one command/task, iteration will be interrupted and the error will be thrown. However, other commands/tasks won't be impacted or cancelled.
      Parameters:
      commands - the collection of commands/tasks to be executed
      Returns:
      an iterator for iterating the results of the commands/tasks
      See Also:
    • asynRun

      public static ObjIterator<Void> asynRun(Collection<? extends Throwables.Runnable<? extends Exception>> commands, Executor executor)
      Executes the specified commands/tasks asynchronously by the specified executor and immediately returns an iterator for iterating the result lazily. The first element will be the result of the command/task which is completed first.
      If an error occurs in one command/task, iteration will be interrupted and the error will be thrown. However, other commands/tasks won't be impacted or cancelled.
      Parameters:
      commands - the collection of commands/tasks to be executed
      executor - the executor to use for processing
      Returns:
      an iterator for iterating the results of the commands/tasks
      See Also:
    • asynCall

      public static <R> ObjIterator<R> asynCall(Collection<? extends Callable<? extends R>> commands)
      Executes the specified commands/tasks asynchronously and immediately returns an iterator for iterating the result lazily. The first element will be the result of the command/task which is completed first.
      If an error occurs in one command/task, iteration will be interrupted and the error will be thrown. However, other commands/tasks won't be impacted or cancelled.
      Parameters:
      commands - the collection of commands/tasks to be executed
      Returns:
      an iterator for iterating the results of the commands/tasks
      See Also:
    • asynCall

      public static <R> ObjIterator<R> asynCall(Collection<? extends Callable<? extends R>> commands, Executor executor) throws IllegalArgumentException
      Executes the specified commands/tasks asynchronously by the specified executor and immediately returns an iterator for iterating the result lazily. The first element will be the result of the command/task which is completed first.
      If an error occurs in one command/task, iteration will be interrupted and the error will be thrown. However, other commands/tasks won't be impacted or cancelled.
      Parameters:
      commands - the collection of commands/tasks to be executed
      executor - the executor to use for processing
      Returns:
      an iterator for iterating the results of the commands/tasks
      Throws:
      IllegalArgumentException
      See Also:
    • runInParallel

      public static void runInParallel(Throwables.Runnable<? extends Exception> command, Throwables.Runnable<? extends Exception> command2)
      Executes and completes the input commands in parallel.
      If an error occurs in one task, cancel() will be called for other unfinished tasks.
      Parameters:
      command - the first command to be executed in current thread.
      command2 - the second command to be executed in another thread.
      Throws:
      Exception - if an error occurs during the execution of any command
      See Also:
    • runInParallel

      public static void runInParallel(Throwables.Runnable<? extends Exception> command, Throwables.Runnable<? extends Exception> command2, Throwables.Runnable<? extends Exception> command3)
      Executes and complete the input commands in parallel.
      if error happens in one task, cancel will be called for other unfinished tasks.
      Parameters:
      command - the first command to be executed in current thread.
      command2 - the second command to be executed in another thread.
      command3 - the third command to be executed in another thread.
      Throws:
      Exception - if an error occurs during the execution of any command
      See Also:
    • runInParallel

      public static void runInParallel(Throwables.Runnable<? extends Exception> command, Throwables.Runnable<? extends Exception> command2, Throwables.Runnable<? extends Exception> command3, Throwables.Runnable<? extends Exception> command4)
      Executes and complete the input commands in parallel.
      if error happens in one task, cancel will be called for other unfinished tasks.
      Parameters:
      command - the first command to be executed in current thread.
      command2 - the second command to be executed in another thread.
      command3 - the third command to be executed in another thread.
      command4 - the fourth command to be executed in another thread.
      Throws:
      Exception - if an error occurs during the execution of any command
      See Also:
    • runInParallel

      public static void runInParallel(Throwables.Runnable<? extends Exception> command, Throwables.Runnable<? extends Exception> command2, Throwables.Runnable<? extends Exception> command3, Throwables.Runnable<? extends Exception> command4, Throwables.Runnable<? extends Exception> command5)
      Executes and complete the input commands in parallel.
      if error happens in one task, cancel will be called for other unfinished tasks.
      Parameters:
      command - the first command to be executed in current thread.
      command2 - the second command to be executed in another thread.
      command3 - the third command to be executed in another thread.
      command4 - the fourth command to be executed in another thread.
      command5 - the fifth command to be executed in another thread.
      Throws:
      Exception - if an error occurs during the execution of any command
      See Also:
    • runInParallel

      public static void runInParallel(Collection<? extends Throwables.Runnable<? extends Exception>> commands)
      Executes the specified collection of commands/tasks in parallel.
      If an error occurs in one task, cancel will be called for other unfinished tasks.
      Parameters:
      commands - the collection of commands/tasks to be executed asynchronously, except the first one which is executed in current thread.
      Throws:
      Exception - if an error occurs during the execution of any command
      See Also:
    • runInParallel

      public static void runInParallel(Collection<? extends Throwables.Runnable<? extends Exception>> commands, Executor executor)
      Executes and complete the input commands in parallel.
      if error happens in one task, cancel will be called for other unfinished tasks.
      Parameters:
      commands - the collection of commands/tasks to be executed asynchronously by the specified execute, except the first one which is executed in current thread.
      executor - the executor to use for processing
      Throws:
      Exception - if an error occurs during the execution of any command
      See Also:
    • callInParallel

      public static <R, R2> Tuple.Tuple2<R,R2> callInParallel(Callable<R> command, Callable<R2> command2)
      Executes and completes the input commands in parallel.
      If an error occurs in one task, cancel() will be called for other unfinished tasks.
      Type Parameters:
      R - the returned type of the first command
      R2 - the returned type of the second command
      Parameters:
      command - the first command to be executed in current thread.
      command2 - the second command to be executed in another thread.
      Returns:
      a tuple containing the results of the two commands
      Throws:
      Exception - if an error occurs during the execution of any command
      See Also:
    • callInParallel

      public static <R, R2, R3> Tuple.Tuple3<R,R2,R3> callInParallel(Callable<R> command, Callable<R2> command2, Callable<R3> command3)
      Executes the specified commands in parallel and returns a tuple containing the results.
      If an error occurs in one task, cancel will be called for other unfinished tasks.
      Type Parameters:
      R - the type of the result of the first command
      R2 - the type of the result of the second command
      R3 - the type of the result of the third command
      Parameters:
      command - the first command to be executed in current thread.
      command2 - the second command to be executed in another thread.
      command3 - the third command to be executed in another thread.
      Returns:
      a tuple containing the results of the three commands
      Throws:
      Exception - if an error occurs during the execution of any command
      See Also:
    • callInParallel

      public static <R, R2, R3, R4> Tuple.Tuple4<R,R2,R3,R4> callInParallel(Callable<R> command, Callable<R2> command2, Callable<R3> command3, Callable<R4> command4)
      Executes the specified commands in parallel and returns a tuple containing the results.
      If an error occurs in one task, cancel will be called for other unfinished tasks.
      Type Parameters:
      R - the type of the result of the first command
      R2 - the type of the result of the second command
      R3 - the type of the result of the third command
      R4 - the type of the result of the fourth command
      Parameters:
      command - the first command to be executed in current thread.
      command2 - the second command to be executed in another thread.
      command3 - the third command to be executed in another thread.
      command4 - the fourth command to be executed in another thread.
      Returns:
      a tuple containing the results of the four commands
      Throws:
      Exception - if an error occurs during the execution of any command
      See Also:
    • callInParallel

      public static <R, R2, R3, R4, R5> Tuple.Tuple5<R,R2,R3,R4,R5> callInParallel(Callable<R> command, Callable<R2> command2, Callable<R3> command3, Callable<R4> command4, Callable<R5> command5)
      Executes the specified commands in parallel and returns a tuple containing the results.
      If an error occurs in one task, cancel will be called for other unfinished tasks.
      Type Parameters:
      R - the type of the result of the first command
      R2 - the type of the result of the second command
      R3 - the type of the result of the third command
      R4 - the type of the result of the fourth command
      R5 - the type of the result of the fifth command
      Parameters:
      command - the first command to be executed in current thread.
      command2 - the second command to be executed in another thread.
      command3 - the third command to be executed in another thread.
      command4 - the fourth command to be executed in another thread.
      command5 - the fifth command to be executed in another thread.
      Returns:
      a tuple containing the results of the five commands
      Throws:
      Exception - if an error occurs during the execution of any command
      See Also:
    • callInParallel

      public static <R> List<R> callInParallel(Collection<? extends Callable<? extends R>> commands)
      Executes the specified collection of commands/tasks in parallel.
      If an error occurs in one task, cancel will be called for other unfinished tasks.
      Parameters:
      commands - the collection of commands/tasks to be executed asynchronously, except the first one which is executed in current thread.
      Returns:
      a list containing the results of all commands
      Throws:
      Exception - if an error occurs during the execution of any command
      See Also:
    • callInParallel

      public static <R> List<R> callInParallel(Collection<? extends Callable<? extends R>> commands, Executor executor) throws IllegalArgumentException
      Executes the specified collection of commands/tasks in parallel.
      If an error occurs in one task, cancel will be called for other unfinished tasks.
      Parameters:
      commands - the collection of commands/tasks to be executed asynchronously by the specified executor, except the first one which is executed in current thread.
      executor - the executor to use for processing
      Returns:
      a list containing the results of all commands
      Throws:
      Exception - if an error occurs during the execution of any command
      IllegalArgumentException
      See Also:
    • runByBatch

      public static <T, E extends Exception> void runByBatch(T[] a, int batchSize, Throwables.Consumer<? super List<T>,E> batchAction) throws IllegalArgumentException, E
      Executes the given action on batches of elements from the provided array.
      The batchAction must not update or cache the input batch elements.
      Type Parameters:
      T - The type of the elements in the array.
      E - The type of the exception that the action may throw.
      Parameters:
      a - The array whose elements are to be processed.
      batchSize - The size of the batches to be processed at a time.
      batchAction - The action to be executed on each batch of elements. The batchAction must not update or cache the input batch elements.
      Throws:
      IllegalArgumentException - if the batchSize is not positive.
      E - if the batchAction throws an exception.
    • runByBatch

      public static <T, E extends Exception> void runByBatch(Iterable<? extends T> iter, int batchSize, Throwables.Consumer<? super List<T>,E> batchAction) throws IllegalArgumentException, E
      Executes the given action on batches of elements from the provided iterable.
      The batchAction must not update or cache the input batch elements.
      Type Parameters:
      T - The type of the elements in the iterable.
      E - The type of the exception that the action may throw.
      Parameters:
      iter - The iterable whose elements are to be processed.
      batchSize - The size of the batches to be processed at a time.
      batchAction - The action to be executed on each batch of elements. The batchAction must not update or cache the input batch elements.
      Throws:
      IllegalArgumentException - if the batchSize is not positive.
      E - if the batchAction throws an exception.
    • runByBatch

      public static <T, E extends Exception> void runByBatch(Iterator<? extends T> iter, int batchSize, Throwables.Consumer<? super List<T>,E> batchAction) throws IllegalArgumentException, E
      Executes the given action on batches of elements from the provided iterator.
      The batchAction must not update or cache the input batch elements.
      Type Parameters:
      T - The type of the elements in the iterator.
      E - The type of the exception that the action may throw.
      Parameters:
      iter - The iterator whose elements are to be processed.
      batchSize - The size of the batches to be processed at a time.
      batchAction - The action to be executed on each batch of elements. The batchAction must not update or cache the input batch elements.
      Throws:
      IllegalArgumentException - if the batchSize is not positive.
      E - if the batchAction throws an exception.
    • runByBatch

      public static <T, E extends Exception, E2 extends Exception> void runByBatch(T[] a, int batchSize, Throwables.IntObjConsumer<? super T,E> elementConsumer, Throwables.Runnable<E2> batchAction) throws IllegalArgumentException, E, E2
      Executes the given batch action after applying the specified element consumer on each batch element with index for preparing batch execution.
      Type Parameters:
      T - The type of the elements in the array.
      E - The type of the exception that the elementConsumer may throw.
      E2 - The type of the exception that the batchAction may throw.
      Parameters:
      a - The array whose elements are to be processed.
      batchSize - The size of the batches to be processed at a time.
      elementConsumer - The action to be applied to each element with index for preparing batch execution.
      batchAction - The action to be executed on each batch of elements.
      Throws:
      IllegalArgumentException - if the batchSize is not positive.
      E - if the elementConsumer throws an exception.
      E2 - if the batchAction throws an exception.
    • runByBatch

      public static <T, E extends Exception, E2 extends Exception> void runByBatch(Iterable<? extends T> iter, int batchSize, Throwables.IntObjConsumer<? super T,E> elementConsumer, Throwables.Runnable<E2> batchAction) throws IllegalArgumentException, E, E2
      Executes the given batch action after applying the specified element consumer on each batch element with index for preparing batch execution.
      Type Parameters:
      T - The type of the elements in the iterable.
      E - The type of the exception that the elementConsumer may throw.
      E2 - The type of the exception that the batchAction may throw.
      Parameters:
      iter - The iterable whose elements are to be processed.
      batchSize - The size of the batches to be processed at a time.
      elementConsumer - The action to be applied to each element with index for preparing batch execution.
      batchAction - The action to be executed on each batch of elements.
      Throws:
      IllegalArgumentException - if the batchSize is not positive.
      E - if the elementConsumer throws an exception.
      E2 - if the batchAction throws an exception.
    • runByBatch

      public static <T, E extends Exception, E2 extends Exception> void runByBatch(Iterator<? extends T> iter, int batchSize, Throwables.IntObjConsumer<? super T,E> elementConsumer, Throwables.Runnable<E2> batchAction) throws IllegalArgumentException, E, E2
      Executes the given batch action after applying the specified element consumer on each batch element with index for preparing batch execution.
      Type Parameters:
      T - The type of the elements in the iterator.
      E - The type of the exception that the elementConsumer may throw.
      E2 - The type of the exception that the batchAction may throw.
      Parameters:
      iter - The iterator whose elements are to be processed.
      batchSize - The size of the batches to be processed at a time.
      elementConsumer - The action to be applied to each element with index for preparing batch execution.
      batchAction - The action to be executed on each batch of elements.
      Throws:
      IllegalArgumentException - if the batchSize is not positive.
      E - if the elementConsumer throws an exception.
      E2 - if the batchAction throws an exception.
    • callByBatch

      public static <T, R, E extends Exception> List<R> callByBatch(T[] a, int batchSize, Throwables.Function<? super List<T>,R,E> batchAction) throws IllegalArgumentException, E
      Executes the given function on batches of elements from the provided array.
      The batchAction must not update or cache the input batch elements.
      Type Parameters:
      T - The type of the elements in the array.
      R - The type of the result returned by the batchAction function.
      E - The type of the exception that the batchAction may throw.
      Parameters:
      a - The array whose elements are to be processed.
      batchSize - The size of the batches to be processed at a time.
      batchAction - The action to be executed on each batch of elements. The batchAction must not update or cache the input batch elements.
      Returns:
      A list of results returned by the batchAction function for each batch of elements.
      Throws:
      IllegalArgumentException - if the batchSize is not positive.
      E - if the batchAction throws an exception.
    • callByBatch

      public static <T, R, E extends Exception> List<R> callByBatch(Iterable<? extends T> iter, int batchSize, Throwables.Function<? super List<T>,R,E> batchAction) throws IllegalArgumentException, E
      Executes the given function on batches of elements from the provided iterable.
      The batchAction must not update or cache the input batch elements.
      Type Parameters:
      T - The type of the elements in the iterable.
      R - The type of the result returned by the batchAction function.
      E - The type of the exception that the batchAction may throw.
      Parameters:
      iter - The iterable whose elements are to be processed.
      batchSize - The size of the batches to be processed at a time.
      batchAction - The action to be executed on each batch of elements. The batchAction must not update or cache the input batch elements.
      Returns:
      A list of results returned by the batchAction function for each batch of elements.
      Throws:
      IllegalArgumentException - if the batchSize is not positive.
      E - if the batchAction throws an exception.
    • callByBatch

      public static <T, R, E extends Exception> List<R> callByBatch(Iterator<? extends T> iter, int batchSize, Throwables.Function<? super List<T>,R,E> batchAction) throws IllegalArgumentException, E
      Executes the given function on batches of elements from the provided iterator.
      The batchAction must not update or cache the input batch elements.
      Type Parameters:
      T - The type of the elements in the iterator.
      R - The type of the result returned by the batchAction function.
      E - The type of the exception that the batchAction may throw.
      Parameters:
      iter - The iterator whose elements are to be processed.
      batchSize - The size of the batches to be processed at a time.
      batchAction - The action to be executed on each batch of elements. The batchAction must not update or cache the input batch elements.
      Returns:
      A list of results returned by the batchAction function for each batch of elements.
      Throws:
      IllegalArgumentException - if the batchSize is not positive.
      E - if the batchAction throws an exception.
    • callByBatch

      public static <T, R, E extends Exception, E2 extends Exception> List<R> callByBatch(T[] a, int batchSize, Throwables.IntObjConsumer<? super T,E> elementConsumer, Throwables.Callable<? extends R,E2> batchAction) throws IllegalArgumentException, E, E2
      Executes the given batch action after applying the specified element consumer on each batch element with index.
      Type Parameters:
      T - The type of the elements in the array.
      R - The type of the result returned by the batchAction function.
      E - The type of the exception that the elementConsumer may throw.
      E2 - The type of the exception that the batchAction may throw.
      Parameters:
      a - The array whose elements are to be processed.
      batchSize - The size of the batches to be processed at a time.
      elementConsumer - The action to be applied to each element with index for preparing batch execution.
      batchAction - The action to be executed on each batch of elements.
      Returns:
      A list of results returned by the batchAction function for each batch of elements.
      Throws:
      IllegalArgumentException - if the batchSize is not positive.
      E - if the elementConsumer throws an exception.
      E2 - if the batchAction throws an exception.
    • callByBatch

      public static <T, R, E extends Exception, E2 extends Exception> List<R> callByBatch(Iterable<? extends T> iter, int batchSize, Throwables.IntObjConsumer<? super T,E> elementConsumer, Throwables.Callable<? extends R,E2> batchAction) throws IllegalArgumentException, E, E2
      Executes the given batch action after applying the specified element consumer on each batch element with index.
      Type Parameters:
      T - The type of the elements in the iterable.
      R - The type of the result returned by the batchAction function.
      E - The type of the exception that the elementConsumer may throw.
      E2 - The type of the exception that the batchAction may throw.
      Parameters:
      iter - The iterable whose elements are to be processed.
      batchSize - The size of the batches to be processed at a time.
      elementConsumer - The action to be applied to each element with index for preparing batch execution.
      batchAction - The action to be executed on each batch of elements.
      Throws:
      IllegalArgumentException - if the batchSize is not positive.
      E - if the elementConsumer throws an exception.
      E2 - if the batchAction throws an exception.
    • callByBatch

      public static <T, R, E extends Exception, E2 extends Exception> List<R> callByBatch(Iterator<? extends T> iter, int batchSize, Throwables.IntObjConsumer<? super T,E> elementConsumer, Throwables.Callable<? extends R,E2> batchAction) throws IllegalArgumentException, E, E2
      Executes the given batch action after applying the specified element consumer on each batch element with index.
      Type Parameters:
      T - The type of the elements in the iterator.
      R - The type of the result returned by the batchAction function.
      E - The type of the exception that the elementConsumer may throw.
      E2 - The type of the exception that the batchAction may throw.
      Parameters:
      iter - The iterator whose elements are to be processed.
      batchSize - The size of the batches to be processed at a time.
      elementConsumer - The action to be applied to each element with index for preparing batch execution.
      batchAction - The action to be executed on each batch of elements.
      Returns:
      A list of results returned by the batchAction function for each batch of elements.
      Throws:
      IllegalArgumentException - if the batchSize is not positive.
      E - if the elementConsumer throws an exception.
      E2 - if the batchAction throws an exception.
    • runUninterruptibly

      public static void runUninterruptibly(Throwables.Runnable<InterruptedException> cmd) throws IllegalArgumentException
      Note: Copied from Google Guava under Apache License v2.0

      If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.
      Parameters:
      cmd -
      Throws:
      IllegalArgumentException
    • runUninterruptibly

      public static void runUninterruptibly(Throwables.LongConsumer<InterruptedException> cmd, long timeoutInMillis) throws IllegalArgumentException
      Note: Copied from Google Guava under Apache License v2.0

      If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.
      Parameters:
      cmd - the command to execute with the remaining time in milliseconds
      timeoutInMillis -
      Throws:
      IllegalArgumentException
    • runUninterruptibly

      public static void runUninterruptibly(@NotNull Throwables.BiConsumer<Long,TimeUnit,InterruptedException> cmd, long timeout, @NotNull TimeUnit unit) throws IllegalArgumentException
      Note: Copied from Google Guava under Apache License v2.0

      If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.
      Parameters:
      cmd - the command to execute with the remaining time and unit
      timeout -
      unit -
      Throws:
      IllegalArgumentException - if the specified unit/cmd is null.
    • callUninterruptibly

      public static <T> T callUninterruptibly(Throwables.Callable<T,InterruptedException> cmd) throws IllegalArgumentException
      Note: Copied from Google Guava under Apache License v2.0

      If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.
      Type Parameters:
      T -
      Parameters:
      cmd -
      Returns:
      Throws:
      IllegalArgumentException
    • callUninterruptibly

      public static <T> T callUninterruptibly(Throwables.LongFunction<? extends T,InterruptedException> cmd, long timeoutInMillis) throws IllegalArgumentException
      Note: Copied from Google Guava under Apache License v2.0

      If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.
      Type Parameters:
      T -
      Parameters:
      cmd - the command to execute with the remaining time in milliseconds
      timeoutInMillis -
      Returns:
      Throws:
      IllegalArgumentException
    • callUninterruptibly

      public static <T> T callUninterruptibly(@NotNull Throwables.BiFunction<Long,TimeUnit,T,InterruptedException> cmd, long timeout, @NotNull TimeUnit unit) throws IllegalArgumentException
      Note: Copied from Google Guava under Apache License v2.0

      If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.
      Type Parameters:
      T -
      Parameters:
      cmd - the command to execute with the remaining time and unit
      timeout -
      unit -
      Returns:
      Throws:
      IllegalArgumentException - if the specified unit/cmd is null.
    • sleep

      public static void sleep(long timeoutInMillis)
      Pauses the execution of the current thread for a specified time.
      Parameters:
      timeoutInMillis - The time, in milliseconds, to pause the thread.
    • sleep

      public static void sleep(long timeout, @NotNull TimeUnit unit) throws IllegalArgumentException
      Pauses the execution of the current thread for a specified time.
      Parameters:
      timeout - The time to pause the thread. The unit of time is determined by the unit parameter.
      unit - The unit of time for the timeout parameter. This should be a valid TimeUnit enumeration value.
      Throws:
      IllegalArgumentException - if the specified unit is null.
    • sleepUninterruptibly

      public static void sleepUninterruptibly(long timeoutInMillis)
      Note: Copied from Google Guava under Apache License v2.0

      If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.
      Parameters:
      timeoutInMillis -
    • sleepUninterruptibly

      public static void sleepUninterruptibly(long timeout, @NotNull TimeUnit unit) throws IllegalArgumentException
      Note: Copied from Google Guava under Apache License v2.0

      If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.
      Parameters:
      timeout -
      unit -
      Throws:
      IllegalArgumentException - if the specified unit is null.
    • tryOrEmptyIfExceptionOccurred

      @Beta public static <R> u.Nullable<R> tryOrEmptyIfExceptionOccurred(Callable<R> cmd)
      Executes the given Callable and returns a Nullable containing the result. If an exception occurs during the execution, an empty Nullable is returned.
      Type Parameters:
      R - the type of the result
      Parameters:
      cmd - the Callable to be executed
      Returns:
      a Nullable containing the result or an empty Nullable if an exception occurs
      See Also:
    • tryOrEmptyIfExceptionOccurred

      @Beta public static <T, R> u.Nullable<R> tryOrEmptyIfExceptionOccurred(T init, Throwables.Function<? super T,? extends R,? extends Exception> func)
      Executes the given function with the provided initial value and returns a Nullable containing the result. If an exception occurs during the execution, an empty Nullable is returned.
      Type Parameters:
      T - the type of the initial value
      R - the type of the result
      Parameters:
      init - the initial value to be passed to the function
      func - the function to be executed
      Returns:
      a Nullable containing the result or an empty Nullable if an exception occurs
      See Also:
    • tryOrDefaultIfExceptionOccurred

      @Beta public static <R> R tryOrDefaultIfExceptionOccurred(Callable<R> cmd, R defaultIfExceptionOccurred)
      Executes the given Callable and returns the result. If an exception occurs during the execution, the provided default value is returned.
      Type Parameters:
      R - the type of the result
      Parameters:
      cmd - the Callable to be executed
      defaultIfExceptionOccurred - the default value to return if an exception occurs
      Returns:
      the result of the Callable or the default value if an exception occurs
      See Also:
    • tryOrDefaultIfExceptionOccurred

      @Beta public static <T, R> R tryOrDefaultIfExceptionOccurred(T init, Throwables.Function<? super T,? extends R,? extends Exception> func, R defaultIfExceptionOccurred)
      Executes the given function with the provided initial value and returns the result. If an exception occurs during the execution, the provided default value is returned.
      Type Parameters:
      T - the type of the initial value
      R - the type of the result
      Parameters:
      init - the initial value to be passed to the function
      func - the function to be executed
      defaultIfExceptionOccurred - the default value to return if an exception occurs
      Returns:
      the result of the function or the default value if an exception occurs
      See Also:
    • tryOrDefaultIfExceptionOccurred

      @Beta public static <R> R tryOrDefaultIfExceptionOccurred(Callable<R> cmd, Supplier<R> supplierForDefaultIfExceptionOccurred)
      Executes the given Callable and returns the result. If an exception occurs during the execution, the result from the provided supplier is returned.
      Type Parameters:
      R - the type of the result
      Parameters:
      cmd - the Callable to be executed
      supplierForDefaultIfExceptionOccurred - the supplier to provide the default value if an exception occurs
      Returns:
      the result of the Callable or the result from the supplier if an exception occurs
      See Also:
    • tryOrDefaultIfExceptionOccurred

      @Beta public static <T, R> R tryOrDefaultIfExceptionOccurred(T init, Throwables.Function<? super T,? extends R,? extends Exception> func, Supplier<R> supplierForDefaultIfExceptionOccurred)
      Executes the given function with the provided initial value and returns the result. If an exception occurs during the execution, the result from the provided supplier is returned.
      Type Parameters:
      T - the type of the initial value
      R - the type of the result
      Parameters:
      init - the initial value to be passed to the function
      func - the function to be executed
      supplierForDefaultIfExceptionOccurred - the supplier to provide the default value if an exception occurs
      Returns:
      the result of the function or the result from the supplier if an exception occurs
      See Also:
    • ifOrEmpty

      @Beta public static <R, E extends Exception> u.Nullable<R> ifOrEmpty(boolean b, Throwables.Supplier<R,E> supplier) throws E
      Returns a Nullable containing the result of the given supplier if the condition is true. If the condition is false, returns an empty Nullable.
      Type Parameters:
      R - the type of the result
      E - the type of the exception that the supplier may throw
      Parameters:
      b - the condition to evaluate
      supplier - the supplier to provide the result if the condition is true
      Returns:
      a Nullable containing the result of the supplier if the condition is true, otherwise an empty Nullable
      Throws:
      E - if the supplier throws an exception
    • ifOrElse

      @Deprecated public static <E1 extends Exception, E2 extends Exception> void ifOrElse(boolean b, Throwables.Runnable<E1> actionForTrue, Throwables.Runnable<E2> actionForFalse) throws E1, E2
      Deprecated.
      it's not a good idea? if-else is better?
      Executes the provided actions based on the boolean condition.
      Type Parameters:
      E1 - The type of exception that the first action may throw.
      E2 - The type of exception that the second action may throw.
      Parameters:
      b - The boolean condition to test.
      actionForTrue - The action to be executed if the condition is true.
      actionForFalse - The action to be executed if the condition is false.
      Throws:
      E1 - if the condition is true and the execution of actionForTrue throws this exception.
      E2 - if the condition is false and the execution of actionForFalse throws this exception.
    • ifNotNull

      @Beta public static <T, E extends Exception> void ifNotNull(T obj, Throwables.Consumer<? super T,E> cmd) throws E
      Executes the given Consumer if the provided object is not null.
      Type Parameters:
      T - the type of the object
      E - the type of the exception that the consumer may throw
      Parameters:
      obj - the object to be checked for null
      cmd - the Consumer to be executed if the object is not null
      Throws:
      E - if the consumer throws an exception
    • ifNotEmpty

      @Beta public static <CS extends CharSequence, E extends Exception> void ifNotEmpty(CS c, Throwables.Consumer<? super CS,E> cmd) throws E
      Executes the provided action if the given CharSequence is not empty.
      Type Parameters:
      CS - The type of the CharSequence.
      E - The type of exception that the action may throw.
      Parameters:
      c - The CharSequence to be tested for emptiness.
      cmd - The action to be executed if the CharSequence is not empty.
      Throws:
      E - if the execution of the action throws this exception.
    • ifNotEmpty

      @Beta public static <C extends Collection, E extends Exception> void ifNotEmpty(C c, Throwables.Consumer<? super C,E> cmd) throws E
      Executes the provided action if the given collection is not empty.
      Type Parameters:
      C - The type of the collection.
      E - The type of exception that the action may throw.
      Parameters:
      c - The collection to be tested for emptiness.
      cmd - The action to be executed if the collection is not empty.
      Throws:
      E - if the execution of the action throws this exception.
    • ifNotEmpty

      @Beta public static <M extends Map, E extends Exception> void ifNotEmpty(M m, Throwables.Consumer<? super M,E> cmd) throws E
      Executes the provided action if the given map is not empty.
      Type Parameters:
      M - The type of the map.
      E - The type of exception that the action may throw.
      Parameters:
      m - The map to be tested for emptiness.
      cmd - The action to be executed if the map is not empty.
      Throws:
      E - if the execution of the action throws this exception.
    • lazyInit

      @Beta public static <T> Supplier<T> lazyInit(Supplier<T> supplier)
      Creates a lazy-initialized supplier from the provided supplier. The supplier's get() method will not be called until necessary and only be called only because the returned value will be cached.
      Type Parameters:
      T - The type of results supplied by this supplier
      Parameters:
      supplier - The supplier to be lazily initialized
      Returns:
      A lazy-initialized supplier
    • lazyInitialize

      @Beta public static <T, E extends Exception> Throwables.Supplier<T,E> lazyInitialize(Throwables.Supplier<T,E> supplier)
      Creates a lazy-initialized supplier from the provided supplier. The supplier's get() method will not be called until necessary and only be called only because the returned value will be cached.
      Type Parameters:
      T - The type of results supplied by this supplier
      Parameters:
      supplier - The supplier to be lazily initialized
      Returns:
      A lazy-initialized supplier
    • toRuntimeException

      @Beta public static RuntimeException toRuntimeException(Exception e)
      Converts the provided exception to a runtime exception.
      Parameters:
      e - The exception to be converted to a runtime exception.
      Returns:
      A RuntimeException that represents the provided exception.
      See Also:
    • toRuntimeException

      @Beta public static RuntimeException toRuntimeException(Throwable e)
      Converts the specified Throwable to a RuntimeException if it's a checked exception or an Error, otherwise returns itself.
      Parameters:
      e - The throwable to be converted to a runtime exception.
      Returns:
      A RuntimeException that represents the provided throwable.
      See Also:
    • toRuntimeException

      @Beta public static RuntimeException toRuntimeException(Throwable e, boolean throwIfItIsError)
      Converts the specified Throwable to a RuntimeException if it's a checked exception, or throws it if it's an Error, based on the provided flag.
      Parameters:
      e - the throwable to be converted to a runtime exception or thrown if it's an error
      throwIfItIsError - a flag indicating whether to throw the throwable if it's an error
      Returns:
      a RuntimeException that represents the provided throwable
      Throws:
      Error - if the throwable is an error and the flag is set to true
      See Also:
    • println

      public static <T> T println(T obj)
      Prints the given object's string representation to the standard output stream (System.out) and returns the object. The object's string representation is obtained by calling N.toString(Object) method.
      Type Parameters:
      T - The type of the object to be printed.
      Parameters:
      obj - The object to be printed.
      Returns:
      The same object that was printed.
    • fprintln

      @SafeVarargs public static void fprintln(String format, Object... args)
      Prints the formatted string to the standard output using the specified format and arguments.
      Type Parameters:
      T - the type of the arguments
      Parameters:
      format - the format string
      args - the arguments referenced by the format specifiers in the format string
      See Also:
    • typeOf

      public static <T> com.landawn.abacus.type.Type<T> typeOf(@NotNull String typeName) throws IllegalArgumentException
      Gets a Type by the given type name.
      Parameters:
      typeName - the name of the type to be retrieved.
      Returns:
      the Type corresponding to the given type name.
      Throws:
      IllegalArgumentException - if the specified typeName is null.
    • typeOf

      public static <T> com.landawn.abacus.type.Type<T> typeOf(@NotNull Class<?> cls) throws IllegalArgumentException
      Gets a Type by the given Class.
      Parameters:
      typeName - the name of the type to be retrieved.
      Returns:
      the Type corresponding to the given type name.
      Throws:
      IllegalArgumentException - if the specified Class is null.
    • defaultValueOf

      public static <T> T defaultValueOf(Class<T> cls)
      Returns the default value of the given class type.
      Type Parameters:
      T -
      Parameters:
      cls - the class type for which the default value is to be returned.
      Returns:
      the default value of the given class type. For example, for an Integer class type, it will return 0.
      Throws:
      IllegalArgumentException - if the specified class type is null.
    • defaultIfNull

      public static boolean defaultIfNull(Boolean b)
      Returns the default value of the given type if the specified object is null or itself if the specified object is not null.
      Parameters:
      b -
      Returns:
    • defaultIfNull

      public static boolean defaultIfNull(Boolean b, boolean defaultForNull)
      Returns the specified default value if the specified object is null or itself if the specified object is not null.
      Parameters:
      b -
      defaultForNull -
      Returns:
    • defaultIfNull

      public static char defaultIfNull(Character c)
      Returns the default value of the given type if the specified object is null or itself if the specified object is not null.
      Parameters:
      c -
      Returns:
    • defaultIfNull

      public static char defaultIfNull(Character c, char defaultForNull)
      Returns the specified default value if the specified object is null or itself if the specified object is not null.
      Parameters:
      c -
      defaultForNull -
      Returns:
    • defaultIfNull

      public static byte defaultIfNull(Byte b)
      Returns the default value of the given type if the specified object is null or itself if the specified object is not null.
      Parameters:
      b -
      Returns:
    • defaultIfNull

      public static byte defaultIfNull(Byte b, byte defaultForNull)
      Returns the specified default value if the specified object is null or itself if the specified object is not null.
      Parameters:
      b -
      defaultForNull -
      Returns:
    • defaultIfNull

      public static short defaultIfNull(Short b)
      Returns the default value of the given type if the specified object is null or itself if the specified object is not null.
      Parameters:
      b -
      Returns:
    • defaultIfNull

      public static short defaultIfNull(Short b, short defaultForNull)
      Returns the specified default value if the specified object is null or itself if the specified object is not null.
      Parameters:
      b -
      defaultForNull -
      Returns:
    • defaultIfNull

      public static int defaultIfNull(Integer b)
      Returns the default value of the given type if the specified object is null or itself if the specified object is not null.
      Parameters:
      b -
      Returns:
    • defaultIfNull

      public static int defaultIfNull(Integer b, int defaultForNull)
      Returns the specified default value if the specified object is null or itself if the specified object is not null.
      Parameters:
      b -
      defaultForNull -
      Returns:
    • defaultIfNull

      public static long defaultIfNull(Long b)
      Returns the default value of the given type if the specified object is null or itself if the specified object is not null.
      Parameters:
      b -
      Returns:
    • defaultIfNull

      public static long defaultIfNull(Long b, long defaultForNull)
      Returns the specified default value if the specified object is null or itself if the specified object is not null.
      Parameters:
      b -
      defaultForNull -
      Returns:
    • defaultIfNull

      public static float defaultIfNull(Float b)
      Returns the default value of the given type if the specified object is null or itself if the specified object is not null.
      Parameters:
      b -
      Returns:
    • defaultIfNull

      public static float defaultIfNull(Float b, float defaultForNull)
      Returns the specified default value if the specified object is null or itself if the specified object is not null.
      Parameters:
      b -
      defaultForNull -
      Returns:
    • defaultIfNull

      public static double defaultIfNull(Double b)
      Returns the default value of the given type if the specified object is null or itself if the specified object is not null.
      Parameters:
      b -
      Returns:
    • defaultIfNull

      public static double defaultIfNull(Double b, double defaultForNull)
      Returns the specified default value if the specified object is null or itself if the specified object is not null.
      Parameters:
      b -
      defaultForNull -
      Returns:
    • defaultIfNull

      public static <T> T defaultIfNull(T obj, T defaultForNull) throws IllegalArgumentException
      Returns the specified default value if the given object is null, otherwise returns the object itself.
      Type Parameters:
      T - the type of the object
      Parameters:
      obj - the object to check for null
      defaultForNull - the default value to return if obj is null
      Returns:
      obj if it is not null, otherwise defaultForNull
      Throws:
      IllegalArgumentException - if the specified default value is null.
    • defaultIfNull

      public static <T> T defaultIfNull(T obj, Supplier<? extends T> supplierForDefault)
      Returns the default value provided by specified Supplier if the specified object is null or itself if the specified object is not null.
      Type Parameters:
      T -
      Parameters:
      obj -
      supplierForDefault -
      Returns:
    • defaultIfEmpty

      public static <T extends CharSequence> T defaultIfEmpty(T str, T defaultStr) throws IllegalArgumentException
      Returns the specified default value if the specified object is empty or itself if the specified object is not empty.
      Type Parameters:
      T -
      Parameters:
      str -
      defaultStr -
      Returns:
      Throws:
      IllegalArgumentException - if the specified default charSequence value is null.
      See Also:
    • defaultIfEmpty

      public static <T extends CharSequence> T defaultIfEmpty(T str, Supplier<? extends T> getterForDefaultStr)
      Returns the default value provided by specified Supplier if the specified object is empty or itself if the specified object is not empty.
      Type Parameters:
      T -
      Parameters:
      str -
      getterForDefaultStr -
      Returns:
      See Also:
    • defaultIfBlank

      public static <T extends CharSequence> T defaultIfBlank(T str, T defaultStr) throws IllegalArgumentException
      Returns the specified default value if the specified object is blank or itself if the specified object is not blank.
      Type Parameters:
      T -
      Parameters:
      str -
      defaultStr -
      Returns:
      Throws:
      IllegalArgumentException - if the specified default charSequence value is null.
      See Also:
    • defaultIfBlank

      public static <T extends CharSequence> T defaultIfBlank(T str, Supplier<? extends T> getterForDefaultStr)
      Returns the default value provided by specified Supplier if the specified object is blank or itself if the specified object is not blank.
      Type Parameters:
      T -
      Parameters:
      str -
      getterForDefaultStr -
      Returns:
      See Also:
    • defaultIfEmpty

      public static <T extends Collection<?>> T defaultIfEmpty(T c, T defaultColl) throws IllegalArgumentException
      Returns the specified default value if the specified Collection/Map is empty or itself if the specified object is not empty.
      Type Parameters:
      T -
      Parameters:
      c -
      defaultColl -
      Returns:
      Throws:
      IllegalArgumentException - if the specified default collection value is null.
    • defaultIfEmpty

      public static <T extends Map<?, ?>> T defaultIfEmpty(T m, T defaultMap) throws IllegalArgumentException
      Returns the specified default value if the specified Collection/Map is empty or itself if the specified object is not empty.
      Type Parameters:
      T -
      Parameters:
      m -
      defaultMap -
      Returns:
      Throws:
      IllegalArgumentException - if the specified default map value is null.
    • stringOf

      public static String stringOf(boolean val)
      Converts the given value to its corresponding String representation.
      Parameters:
      val - the value to be converted.
      Returns:
      the String representation of the given value. Returns "true" if the value is true, "false" otherwise.
    • stringOf

      public static String stringOf(char val)
      Converts the given value to its corresponding String representation.
      Parameters:
      val - the value to be converted.
      Returns:
      the String representation of the given value.
    • stringOf

      public static String stringOf(byte val)
      Converts the given value to its corresponding String representation.
      Parameters:
      val - the value to be converted.
      Returns:
      the String representation of the given value.
    • stringOf

      public static String stringOf(short val)
      Converts the given value to its corresponding String representation.
      Parameters:
      val - the value to be converted.
      Returns:
      the String representation of the given value.
    • stringOf

      public static String stringOf(int val)
      Converts the given value to its corresponding String representation.
      Parameters:
      val - the value to be converted.
      Returns:
      the String representation of the given value.
    • stringOf

      public static String stringOf(long val)
      Converts the given value to its corresponding String representation.
      Parameters:
      val - the value to be converted.
      Returns:
      the String representation of the given value.
    • stringOf

      public static String stringOf(float val)
      Converts the given value to its corresponding String representation.
      Parameters:
      val - the value to be converted.
      Returns:
      the String representation of the given value.
    • stringOf

      public static String stringOf(double val)
      Converts the given value to its corresponding String representation.
      Parameters:
      val - the value to be converted.
      Returns:
      the String representation of the given value.
    • stringOf

      public static String stringOf(Object obj)
      Converts the given value to its corresponding String representation by Type.stringOf(Object).
      Parameters:
      val - the value to be converted.
      Returns:
      the String representation of the given value. null if the specified object is null
      See Also:
      • CommonUtil.<T>valueOf(java.lang.String,java.lang.Class<? extends T>)
      • Type.stringOf(Object)
    • valueOf

      public static <T> T valueOf(String str, Class<? extends T> targetType)
      Converts the given string to its corresponding value of the specified target type by typeOf(targetType).valueOf(str).
      Type Parameters:
      T - The type of the target object after conversion.
      Parameters:
      str - The string to be converted.
      targetType - The class of the target type to which the string is to be converted.
      Returns:
      The converted value of the specified target type. If the input string is null, it returns the default value of the target type.
      Throws:
      IllegalArgumentException - if the specified target type is null.
      See Also:
      • CommonUtil.stringOf(java.lang.Object)
      • Type.valueOf(String)
    • registerConverter

      public static boolean registerConverter(@NotNull Class<?> srcClass, BiFunction<?,Class<?>,?> converter) throws IllegalArgumentException
      Registers a converter for a specific source class. The converter is a function that takes an object of the source class and a target class, and converts the source object into an instance of the target class.
      Type Parameters:
      T - The type of the source object to be converted.
      R - The type of the target object after conversion.
      Parameters:
      srcClass - The source class that the converter can convert from. This must not be a built-in class.
      converter - The converter function that takes a source object and a target class, and returns an instance of the target class.
      Returns:
      true if there is no converter registered with specified srcClass yet before this call.
      Throws:
      IllegalArgumentException - if the specified srcClass is a built-in class or if either srcClass or converter is null.
    • convert

      public static <T> T convert(Object srcObj, Class<? extends T> targetType) throws IllegalArgumentException, NumberFormatException, RuntimeException
      Converts the given source object to the specified target type. If the source object is null, the default value of the target type is returned. If the source object can be converted to the target type, an instance of the target type is returned.
      Type Parameters:
      T - The type of the target object after conversion.
      Parameters:
      srcObj - The source object to be converted. If null, the default value of the target type is returned.
      targetType - The class of the target type to which the source object is to be converted.
      Returns:
      An instance of the target type converted from the source object, or the default value of the target type if the source object is null.
      Throws:
      IllegalArgumentException - if the source object cannot be converted to the target type.
      NumberFormatException - if string value of the source object cannot be parsed to the target(Number) type.
      RuntimeException - if any other error occurs during the conversion.
    • convert

      public static <T> T convert(Object srcObj, com.landawn.abacus.type.Type<? extends T> targetType) throws IllegalArgumentException, NumberFormatException, RuntimeException
      Converts the given source object to the specified target type using the provided Type instance. If the source object is null, the default value of the target type is returned. If the source object can be converted to the target type, an instance of the target type is returned.
      Type Parameters:
      T - The type of the target object after conversion.
      Parameters:
      srcObj - The source object to be converted.
      targetType - The Type instance of the target type to which the source object is to be converted.
      Returns:
      An instance of the target type converted from the source object, or the default value of the target type if the source object is null.
      Throws:
      IllegalArgumentException - if the source object cannot be converted to the target type.
      NumberFormatException - if string value of the source object cannot be parsed to the target(Number) type.
      RuntimeException - if any other error occurs during the conversion.
    • castIfAssignable

      @Beta public static <T> u.Nullable<T> castIfAssignable(Object val, Class<? extends T> targetType)
      Casts the given object to the specified target type if possible. If the object is null or cannot be assigned to the target type, an empty Nullable is returned. Note that null can be assigned to any Object type except primitive types: boolean/char/byte/short/int/long/double.
      Type Parameters:
      T - The type of the target object after casting.
      Parameters:
      val - The object to be casted.
      targetType - The class of the target type to which the object is to be casted.
      Returns:
      A Nullable containing the casted object if the casting is successful, or an empty Nullable if the object is null or cannot be casted to the target type.
    • castIfAssignable

      @Beta public static <T> u.Nullable<T> castIfAssignable(Object val, com.landawn.abacus.type.Type<? extends T> targetType)
      Casts the given object to the specified target type if possible using the provided Type instance. If the object is null or cannot be assigned to the target type, an empty Nullable is returned. Note that null can be assigned to any Object type except primitive types: boolean/char/byte/short/int/long/double.
      Type Parameters:
      T - The type of the target object after casting.
      Parameters:
      val - The object to be casted.
      targetType - The Type instance of the target type to which the object is to be casted.
      Returns:
      A Nullable containing the casted object if the casting is successful, or an empty Nullable if the object is null or cannot be casted to the target type.
    • getPropNames

      public static ImmutableList<String> getPropNames(Class<?> beanClass)
      Retrieves the property names of the given bean class.
      Parameters:
      beanClass - the class of the bean whose property names are to be retrieved.
      Returns:
      an ImmutableList of strings representing the property names of the given bean class.
      Throws:
      IllegalArgumentException - if the specified bean class is null.
      See Also:
    • getPropNames

      public static List<String> getPropNames(Class<?> beanClass, Set<String> propNameToExclude)
      Retrieves the property names of the given bean class excluding the specified property names.
      Parameters:
      beanClass - the class of the bean whose property names are to be retrieved.
      propNameToExclude - a set of property names to be excluded from the returned list.
      Returns:
      a List of strings representing the property names of the given bean class excluding the specified property names.
      Throws:
      IllegalArgumentException - if the specified bean class is null.
      See Also:
    • getPropNames

      public static List<String> getPropNames(Object bean)
      Retrieves the property names of the given bean object.
      Parameters:
      bean - The bean object whose property names are to be retrieved.
      Returns:
      A list of strings representing the property names of the given bean object.
      Throws:
      IllegalArgumentException - if the specified bean object is null.
      See Also:
    • getPropNames

      public static List<String> getPropNames(Object bean, boolean ignoreNullValue)
      Retrieves the property names of the given bean object.
      Parameters:
      bean - The bean object whose property names are to be retrieved.
      ignoreNullValue - If true, the method will ignore property names with null values.
      Returns:
      A list of strings representing the property names of the given bean object. If ignoreNullValue is true, properties with null values are not included in the list.
      Throws:
      IllegalArgumentException - if the specified bean object is null.
      See Also:
    • getPropValue

      public static <T> T getPropValue(Object bean, String propName)
      Retrieves the value of the specified property from the given bean object.
      Type Parameters:
      T - The type of the property value.
      Parameters:
      bean - The bean object from which the property value is to be retrieved.
      propName - The name of the property whose value is to be retrieved.
      Returns:
      The value of the specified property of the given bean object.
      Throws:
      IllegalArgumentException - if the specified bean object is null.
      See Also:
    • getPropValue

      public static <T> T getPropValue(Object bean, String propName, boolean ignoreUnmatchedProperty)
      Retrieves the value of the specified property from the given bean object.
      Type Parameters:
      T - The type of the property value.
      Parameters:
      bean - The bean object from which the property value is to be retrieved.
      propName - The name of the property whose value is to be retrieved.
      ignoreUnmatchedProperty - If true, the method will not throw an exception if the property does not exist in the bean object.
      Returns:
      The value of the specified property of the given bean object.
      Throws:
      IllegalArgumentException - if the specified bean object is null or if the property does not exist and ignoreUnmatchedProperty is false.
      See Also:
    • setPropValue

      @Deprecated public static void setPropValue(Object bean, String propName, Object propValue)
      Sets the value of the specified property in the given bean object.
      Refer to setPropValue(Method, Object, Object).
      Parameters:
      bean - The bean object in which the property value is to be set.
      propName - The name of the property whose value is to be set. The property name is case insensitive.
      propValue - The new value to be set for the specified property in the given bean object.
      Throws:
      IllegalArgumentException - if the specified bean object is null.
      See Also:
    • clone

      @MayReturnNull public static <T> T clone(T obj)
      Clones the given object. The object must be serializable and deserializable through Kryo or JSON.
      Type Parameters:
      T -
      Parameters:
      obj - a Java object which must be serializable and deserializable through Kryo or JSON.
      Returns:
      null if bean is null
    • clone

      public static <T> T clone(Object obj, @NotNull Class<? extends T> targetType) throws IllegalArgumentException
      Deeply copy by: obj -> serialize -> kryo/Json -> deserialize -> new object.
      Type Parameters:
      T -
      Parameters:
      obj - a Java object which must be serializable and deserialiable through Kryo or JSON.
      targetType -
      Returns:
      a new instance of targetType even if bean is null.
      Throws:
      IllegalArgumentException - if targetType is null.
    • copy

      @MayReturnNull public static <T> T copy(T sourceBean)
      Returns a copy of the given source bean.
      Type Parameters:
      T - the type of the source bean
      Parameters:
      sourceBean - the source bean to copy
      Returns:
      a new instance of the same class with the same properties copied from the source bean, or null if the source bean is null
    • copy

      @MayReturnNull public static <T> T copy(T sourceBean, Collection<String> selectPropNames)
      Returns a copy of the given source bean with selected properties.
      Type Parameters:
      T - the type of the source bean
      Parameters:
      sourceBean - the source bean to copy
      selectPropNames - the collection of property names to be copied
      Returns:
      a new instance of the same class with the selected properties copied from the source bean, or null if the source bean is null
    • copy

      @MayReturnNull public static <T> T copy(T sourceBean, BiPredicate<? super String,?> propFilter)
      Returns a copy of the given source bean with properties filtered by the specified predicate.
      Type Parameters:
      T - the type of the source bean
      Parameters:
      sourceBean - the source bean to copy
      propFilter - the predicate to filter properties to be copied
      Returns:
      a new instance of the same class with the filtered properties copied from the source bean, or null if the source bean is null
    • copy

      public static <T> T copy(Object sourceBean, Class<? extends T> targetType) throws IllegalArgumentException
      Returns a new instance of specified targetType with properties copied from the given source bean.
      Type Parameters:
      T - the type of the target bean
      Parameters:
      sourceBean - the source bean to copy
      targetType - the class of the target type
      Returns:
      a new instance of the target type, even if the source bean is null
      Throws:
      IllegalArgumentException - if the specified targetType is null
    • copy

      public static <T> T copy(Object sourceBean, Collection<String> selectPropNames, @NotNull Class<? extends T> targetType) throws IllegalArgumentException
      Returns a new instance of specified targetType with properties copied from the given source bean with selected properties.
      Type Parameters:
      T - the type of the target bean
      Parameters:
      sourceBean - the source bean to copy
      selectPropNames - the collection of property names to be copied
      targetType - the class of the target type
      Returns:
      a new instance of the target type, even if the source bean is null
      Throws:
      IllegalArgumentException - if the specified targetType is null
    • copy

      public static <T> T copy(Object sourceBean, Collection<String> selectPropNames, Function<String,String> propNameConverter, @NotNull Class<? extends T> targetType) throws IllegalArgumentException
      Returns a new instance of specified targetType with properties copied from the given source bean with selected properties.
      Type Parameters:
      T - the type of the target bean
      Parameters:
      sourceBean - the source bean to copy
      selectPropNames - the collection of property names to be copied
      propNameConverter - A Function used to convert the property names from the source object to the target object. The function takes a property name from the source object and returns the corresponding property name in the target object.
      targetType - the class of the target type
      Returns:
      a new instance of the target type, even if the source bean is null
      Throws:
      IllegalArgumentException - if the specified targetType is null
    • copy

      public static <T> T copy(Object sourceBean, BiPredicate<? super String,?> propFilter, Class<? extends T> targetType) throws IllegalArgumentException
      Returns a new instance of specified targetType with properties copied from the given source bean, filtered by the specified predicate.
      Type Parameters:
      T - the type of the target bean
      Parameters:
      sourceBean - the source bean to copy
      propFilter - A BiPredicate used to filter the properties to be copied. The predicate takes a property name and its value, and returns true if the property should be copied.
      targetType - the class of the target type
      Returns:
      a new instance of the target type, even if the source bean is null
      Throws:
      IllegalArgumentException - if targetBean is null.
    • copy

      public static <T> T copy(Object sourceBean, BiPredicate<? super String,?> propFilter, Function<String,String> propNameConverter, Class<? extends T> targetType) throws IllegalArgumentException
      Returns a new instance of specified targetType with properties copied from the given source bean, filtered by the specified predicate.
      Type Parameters:
      T - the type of the target bean
      Parameters:
      sourceBean - the source bean to copy
      propFilter - A BiPredicate used to filter the properties to be copied. The predicate takes a property name and its value, and returns true if the property should be copied.
      propNameConverter - A Function used to convert the property names from the source object to the target object. The function takes a property name from the source object and returns the corresponding property name in the target object.
      targetType - the class of the target type
      Returns:
      a new instance of the target type, even if the source bean is null
      Throws:
      IllegalArgumentException - if targetBean is null.
    • copy

      public static <T> T copy(Object sourceBean, boolean ignoreUnmatchedProperty, Set<String> ignoredPropNames, @NotNull Class<? extends T> targetType) throws IllegalArgumentException
      Returns a new instance of specified targetType with properties copied from the given source bean, except the properties specified in the ignoredPropNames set.
      Type Parameters:
      T - the type of the target bean
      Parameters:
      sourceBean - the source bean to copy
      ignoreUnmatchedProperty - if true, unmatched properties will be ignored, otherwise an exception will be thrown if unmatched properties are found
      ignoredPropNames - the set of property names to be ignored during copying
      targetType - the class of the target type
      Returns:
      a new instance of the target type, even if the source bean is null
      Throws:
      IllegalArgumentException - if the specified targetType is null
    • merge

      public static <T> T merge(Object sourceBean, T targetBean) throws IllegalArgumentException
      Merges the properties from the source object into the target object. The source object's properties will overwrite the same properties in the target object.
      Type Parameters:
      T - The type of the target object.
      Parameters:
      sourceBean - The source object from which properties are to be copied. This object should allow access to properties using getter methods.
      targetBean - The target object into which properties are to be copied. This object should allow access to properties using setter methods.
      Returns:
      The specified target object with the merged properties.
      Throws:
      IllegalArgumentException - if targetBean is null.
    • merge

      public static <T> T merge(Object sourceBean, T targetBean, BinaryOperator<?> mergeFunc) throws IllegalArgumentException
      Merges the properties from the source object into the target object using the specified merge function. The source object's properties will overwrite the same properties in the target object.
      Type Parameters:
      T - The type of the target object.
      Parameters:
      sourceBean - The source object from which properties are to be copied. This object should allow access to properties using getter methods.
      targetBean - The target object into which properties are to be copied. This object should allow access to properties using setter methods.
      mergeFunc - A BinaryOperator used to merge the property values from the source object and the target object. The operator takes two parameters: the source property value and the target property value, and returns the resolved value to be set in the target object.
      Returns:
      The specified target object with the merged properties.
      Throws:
      IllegalArgumentException - if targetBean is null.
    • merge

      public static <T> T merge(Object sourceBean, T targetBean, Function<String,String> propNameConverter, BinaryOperator<?> mergeFunc) throws IllegalArgumentException
      Merges the properties from the source object into the target object using the specified merge function. The source object's properties will overwrite the same properties in the target object.
      Type Parameters:
      T - The type of the target object.
      Parameters:
      sourceBean - The source object from which properties are to be copied. This object should allow access to properties using getter methods.
      targetBean - The target object into which properties are to be copied. This object should allow access to properties using setter methods.
      propNameConverter - A Function used to convert the property names from the source object to the target object. The function takes a property name from the source object and returns the corresponding property name in the target object.
      mergeFunc - A BinaryOperator used to merge the property values from the source object and the target object. The operator takes two parameters: the source property value and the target property value, and returns the resolved value to be set in the target object.
      Returns:
      The specified target object with the merged properties.
      Throws:
      IllegalArgumentException - if targetBean is null.
    • merge

      public static <T> T merge(Object sourceBean, @NotNull T targetBean, Collection<String> selectPropNames) throws IllegalArgumentException
      Merges the selected properties from the source object into the target object. The source object's properties will overwrite the same properties in the target object.
      Type Parameters:
      T - The type of the target object.
      Parameters:
      sourceBean - The source object from which properties are to be copied. This object should allow access to properties using getter methods.
      targetBean - The target object into which properties are to be copied. This object should allow access to properties using setter methods.
      selectPropNames - The collection of property names to be merged.
      Returns:
      The specified target object with the merged properties.
      Throws:
      IllegalArgumentException - if targetBean is null.
    • merge

      public static <T> T merge(Object sourceBean, @NotNull T targetBean, Collection<String> selectPropNames, BinaryOperator<?> mergeFunc) throws IllegalArgumentException
      Merges the selected properties from the source object into the target object using the specified merge function. The source object's properties will overwrite the same properties in the target object.
      Type Parameters:
      T - The type of the target object.
      Parameters:
      sourceBean - The source object from which properties are to be copied. This object should allow access to properties using getter methods.
      targetBean - The target object into which properties are to be copied. This object should allow access to properties using setter methods.
      selectPropNames - The collection of property names to be merged.
      mergeFunc - A BinaryOperator used to merge the property values from the source object and the target object. The operator takes two parameters: the source property value and the target property value, and returns the resolved value to be set in the target object.
      Returns:
      The specified target object with the merged properties.
      Throws:
      IllegalArgumentException - if targetBean is null.
    • merge

      public static <T> T merge(Object sourceBean, @NotNull T targetBean, Collection<String> selectPropNames, Function<String,String> propNameConverter) throws IllegalArgumentException
      Merges the selected properties from the source object into the target object. The source object's properties will overwrite the same properties in the target object.
      Type Parameters:
      T - The type of the target object.
      Parameters:
      sourceBean - The source object from which properties are to be copied. This object should allow access to properties using getter methods.
      targetBean - The target object into which properties are to be copied. This object should allow access to properties using setter methods.
      selectPropNames - The collection of property names to be merged.
      propNameConverter - A Function used to convert the property names from the source object to the target object. The function takes a property name from the source object and returns the corresponding property name in the target object.
      Returns:
      The specified target object with the merged properties.
      Throws:
      IllegalArgumentException - if targetBean is null.
    • merge

      public static <T> T merge(Object sourceBean, @NotNull T targetBean, Collection<String> selectPropNames, Function<String,String> propNameConverter, BinaryOperator<?> mergeFunc) throws IllegalArgumentException
      Merges the selected properties from the source object into the target object using the specified merge function. The source object's properties will overwrite the same properties in the target object.
      Type Parameters:
      T - The type of the target object.
      Parameters:
      sourceBean - The source object from which properties are to be copied. This object should allow access to properties using getter methods.
      targetBean - The target object into which properties are to be copied. This object should allow access to properties using setter methods.
      selectPropNames - The collection of property names to be merged.
      propNameConverter - A Function used to convert the property names from the source object to the target object. The function takes a property name from the source object and returns the corresponding property name in the target object.
      mergeFunc - A BinaryOperator used to merge the property values from the source object and the target object. The operator takes two parameters: the source property value and the target property value, and returns the resolved value to be set in the target object.
      Returns:
      The specified target object with the merged properties.
      Throws:
      IllegalArgumentException - if targetBean is null.
    • merge

      public static <T> T merge(Object sourceBean, T targetBean, BiPredicate<? super String,?> propFilter) throws IllegalArgumentException
      Merges the filtered properties from the source object into the target object, The source object's properties will overwrite the same properties in the target object.
      Type Parameters:
      T - The type of the target object.
      Parameters:
      sourceBean - The source object from which properties are to be copied. This object should allow access to properties using getter methods.
      targetBean - The target object into which properties are to be copied. This object should allow access to properties using setter methods.
      propFilter - A BiPredicate used to filter the properties to be merged. The predicate takes a property name and its value, and returns true if the property should be merged.
      Returns:
      The specified target object with the merged properties.
      Throws:
      IllegalArgumentException - if targetBean is null.
    • merge

      public static <T> T merge(Object sourceBean, @NotNull T targetBean, BiPredicate<? super String,?> propFilter, BinaryOperator<?> mergeFunc) throws IllegalArgumentException
      Merges the filtered properties from the source object into the target object using the specified merge function. The source object's properties will overwrite the same properties in the target object.
      Type Parameters:
      T - The type of the target object after merging.
      Parameters:
      sourceBean - The source object whose properties are to be merged. This object should allow access to properties using getter methods.
      targetBean - The target object to which the properties are to be merged. This object should allow access to properties using setter methods.
      propFilter - A BiPredicate used to filter the properties to be merged. The predicate takes a property name and its value, and returns true if the property should be merged.
      mergeFunc - A BinaryOperator used to merge the property values from the source object and the target object. The operator takes two parameters: the source property value and the target property value, and returns the resolved value to be set in the target object.
      Returns:
      The specified target object with the merged properties.
      Throws:
      IllegalArgumentException - if targetBean is null.
    • merge

      public static <T> T merge(Object sourceBean, @NotNull T targetBean, BiPredicate<? super String,?> propFilter, Function<String,String> propNameConverter) throws IllegalArgumentException
      Merges the filtered properties from the source object into the target object using the specified merge function. The source object's properties will overwrite the same properties in the target object.
      Type Parameters:
      T - The type of the target object after merging.
      Parameters:
      sourceBean - The source object whose properties are to be merged. This object should allow access to properties using getter methods.
      targetBean - The target object to which the properties are to be merged. This object should allow access to properties using setter methods.
      propFilter - A BiPredicate used to filter the properties to be merged. The predicate takes a property name and its value, and returns true if the property should be merged.
      propNameConverter - A Function used to convert the property names from the source object to the target object. The function takes a property name from the source object and returns the corresponding property name in the target object.
      Returns:
      The specified target object with the merged properties.
      Throws:
      IllegalArgumentException - if targetBean is null.
    • merge

      public static <T> T merge(Object sourceBean, @NotNull T targetBean, BiPredicate<? super String,?> propFilter, Function<String,String> propNameConverter, BinaryOperator<?> mergeFunc) throws IllegalArgumentException
      Merges the filtered properties from the source object into the target object using the specified merge function. The source object's properties will overwrite the same properties in the target object.
      Type Parameters:
      T - The type of the target object after merging.
      Parameters:
      sourceBean - The source object whose properties are to be merged. This object should allow access to properties using getter methods.
      targetBean - The target object to which the properties are to be merged. This object should allow access to properties using setter methods.
      propFilter - A BiPredicate used to filter the properties to be merged. The predicate takes a property name and its value, and returns true if the property should be merged.
      propNameConverter - A Function used to convert the property names from the source object to the target object. The function takes a property name from the source object and returns the corresponding property name in the target object.
      mergeFunc - A BinaryOperator used to merge the property values from the source object and the target object. The operator takes two parameters: the source property value and the target property value, and returns the resolved value to be set in the target object.
      Returns:
      The specified target object with the merged properties.
      Throws:
      IllegalArgumentException - if targetBean is null.
    • merge

      public static <T> T merge(Object sourceBean, @NotNull T targetBean, boolean ignoreUnmatchedProperty, Set<String> ignoredPropNames) throws IllegalArgumentException
      Merges the properties from the source object into the target object, except the properties specified in the ignoredPropNames set. The source object's properties will overwrite the same properties in the target object.
      Type Parameters:
      T - The type of the target object.
      Parameters:
      sourceBean - The source object from which properties are to be copied. This object should allow access to properties using getter methods.
      targetBean - The target object into which properties are to be copied. This object should allow access to properties using setter methods.
      ignoreUnmatchedProperty - if true, unmatched properties will be ignored, otherwise an exception will be thrown if unmatched properties are found
      ignoredPropNames - The set of property names to be ignored during merging.
      Returns:
      The specified target object with the merged properties.
      Throws:
      IllegalArgumentException - if targetBean is null.
    • merge

      public static <T> T merge(Object sourceBean, @NotNull T targetBean, boolean ignoreUnmatchedProperty, Set<String> ignoredPropNames, BinaryOperator<?> mergeFunc) throws IllegalArgumentException
      Merges the properties from the source object into the target object using the specified merge function, except the properties specified in the ignoredPropNames set. The source object's properties will overwrite the same properties in the target object.
      Type Parameters:
      T - The type of the target object.
      Parameters:
      sourceBean - The source object from which properties are to be copied. This object should allow access to properties using getter methods.
      targetBean - The target object into which properties are to be copied. This object should allow access to properties using setter methods.
      ignoreUnmatchedProperty - if true, unmatched properties will be ignored, otherwise an exception will be thrown if unmatched properties are found
      ignoredPropNames - The set of property names to be ignored during merging.
      mergeFunc - A BinaryOperator used to merge the property values from the source object and the target object. The operator takes two parameters: the source property value and the target property value, and returns the resolved value to be set in the target object.
      Returns:
      The specified target object with the merged properties.
      Throws:
      IllegalArgumentException - if targetBean is null.
    • erase

      @SafeVarargs public static void erase(Object bean, String... propNames)
      Erases the properties of the given bean object. This method sets the properties specified by the property names to their default values. The default value is determined by the type of the property. For example, primitive numeric properties are set to 0, primitive boolean properties are set to false, and object properties are set to null.
      Parameters:
      bean - The bean object whose properties are to be erased. If this is null, the method does nothing.
      propNames - The names of the properties to be erased. These should correspond to the getter/setter methods in the bean object. If this is empty, the method does nothing.
    • erase

      public static void erase(Object bean, Collection<String> propNames)
      Erases the properties of the given bean object. This method sets the properties specified by the property names to their default values. The default value is determined by the type of the property. For example, primitive numeric properties are set to 0, primitive boolean properties are set to false, and object properties are set to null.
      Parameters:
      bean - The bean object whose properties are to be erased. If this is null, the method does nothing.
      propNames - The names of the properties to be erased. These should correspond to the getter/setter methods in the bean object. If this is empty, the method does nothing.
    • eraseAll

      public static void eraseAll(Object bean)
      Erases all the properties of the given bean object. This method sets all properties of the bean object to their default values. The default value is determined by the type of the property. For example, primitive numeric properties are set to 0, primitive boolean properties are set to false, and object properties are set to null.
      Parameters:
      bean - The bean object whose properties are to be erased. If this is null, the method does nothing.
    • enumListOf

      public static <E extends Enum<E>> ImmutableList<E> enumListOf(Class<E> enumClass)
      Returns an immutable/unmodifiable list of all the enum constants in the specified enum class. This method retrieves all the enum constants defined in the given enum class and returns them as an ImmutableList. The order of the constants in the list is the order in which they're declared in the enum class.
      Type Parameters:
      E - The type of the enum constants. This should be an enum type.
      Parameters:
      enumClass - The class object of the enum type whose constants are to be listed. Must not be null.
      Returns:
      An ImmutableList containing all the enum constants in the order they're declared in the enum class.
    • enumSetOf

      public static <E extends Enum<E>> ImmutableSet<E> enumSetOf(Class<E> enumClass)
      Returns an immutable/unmodifiable set of all the enum constants in the specified enum class. This method retrieves all the enum constants defined in the given enum class and returns them as an ImmutableSet. The order of the constants in the set is the order in which they're declared in the enum class.
      Type Parameters:
      E - The type of the enum constants. This should be an enum type.
      Parameters:
      enumClass - The class object of the enum type whose constants are to be listed. Must not be null.
      Returns:
      An ImmutableSet containing all the enum constants in the order they're declared in the enum class.
    • enumMapOf

      public static <E extends Enum<E>> ImmutableBiMap<E,String> enumMapOf(Class<E> enumClass)
      Returns an immutable/unmodifiable bi-directional map of all the enum constants in the specified enum class to their names. This method retrieves all the enum constants defined in the given enum class and maps them to their names as an ImmutableBiMap. The order of the constants in the map is the order in which they're declared in the enum class.
      Type Parameters:
      E - The type of the enum constants. This should be an enum type.
      Parameters:
      enumClass - The class object of the enum type whose constants are to be listed. Must not be null.
      Returns:
      An ImmutableBiMap where each key-value pair corresponds to an enum constant and its name.
    • newProxyInstance

      public static <T> T newProxyInstance(Class<T> interfaceClass, InvocationHandler h)
      Creates a new proxy instance for the specified interface using the provided invocation handler. This method is a utility for creating dynamic proxies. A dynamic proxy class is a class that implements a list of interfaces specified at runtime such that a method invocation through one of the interfaces on an instance of the class will be encoded and dispatched to another object through a uniform interface. Thus, a dynamic proxy class can be used to create an object that can implement an arbitrary set of interfaces specified at runtime.
      Type Parameters:
      T - The type of the interface for the proxy class to implement.
      Parameters:
      interfaceClass - The Class object of the interface for the proxy class to implement. Must not be null.
      h - The invocation handler to dispatch method invocations to. It's a object that implements the InvocationHandler interface.
      Returns:
      a proxy instance that implements the specified interface(s) and dispatches method invocations to the specified invocation handler.
      See Also:
    • newProxyInstance

      public static <T> T newProxyInstance(Class<?>[] interfaceClasses, InvocationHandler h)
      Creates a new proxy instance for the specified interfaces using the provided invocation handler. This method is a utility for creating dynamic proxies. A dynamic proxy class is a class that implements a list of interfaces specified at runtime such that a method invocation through one of the interfaces on an instance of the class will be encoded and dispatched to another object through a uniform interface. Thus, a dynamic proxy class can be used to create an object that can implement an arbitrary set of interfaces specified at runtime.
      Type Parameters:
      T - The type of the interface for the proxy class to implement.
      Parameters:
      interfaceClasses - The array of Class objects of the interfaces for the proxy class to implement. Must not be null.
      h - The invocation handler to dispatch method invocations to. It's an object that implements the InvocationHandler interface.
      Returns:
      a proxy instance that implements the specified interface(s) and dispatches method invocations to the specified invocation handler.
      See Also:
    • newInstance

      public static <T> T newInstance(Class<T> cls)
      Creates a new instance of the specified class.
      Type Parameters:
      T - the type of the object to be created
      Parameters:
      cls - the class of the object to be created
      Returns:
      a new instance of the specified class
      Throws:
      IllegalArgumentException - if the class is abstract or cannot be instantiated
      See Also:
    • newBean

      public static <T> T newBean(Class<T> targetType)
      Creates a new instance of the specified bean class.
      Type Parameters:
      T - the type of the object to be created
      Parameters:
      targetType - the class of the object to be created
      Returns:
      a new instance of the specified class
      Throws:
      IllegalArgumentException - if the class is abstract or cannot be instantiated
    • newCollection

      public static <T> Collection<T> newCollection(Class<? extends Collection> targetType)
      Creates a new collection of the specified type.
      Type Parameters:
      T - the type of elements in the collection
      Parameters:
      targetType - the class of the collection to be created
      Returns:
      a new collection of the specified type
      See Also:
    • newCollection

      public static <T> Collection<T> newCollection(Class<? extends Collection> targetType, int size)
      Creates a new collection of the specified type with the given initial size.
      Type Parameters:
      T - the type of elements in the collection
      Parameters:
      targetType - the class of the collection to be created
      size - the initial size of the collection
      Returns:
      a new collection of the specified type with the given initial size
      See Also:
    • newMap

      public static <K, V> Map<K,V> newMap(Class<? extends Map> targetType)
      Creates a new map of the specified type.
      Type Parameters:
      K - the type of keys maintained by the map
      V - the type of mapped values
      Parameters:
      targetType - the class of the map to be created
      Returns:
      a new map of the specified type
      See Also:
    • newMap

      public static <K, V> Map<K,V> newMap(Class<? extends Map> targetType, int size)
      Creates a new map of the specified type with the given initial size.
      Type Parameters:
      K - the type of keys maintained by the map
      V - the type of mapped values
      Parameters:
      targetType - the class of the map to be created
      size - the initial size of the map
      Returns:
      a new map of the specified type with the given initial size
      See Also:
    • newArray

      public static <T> T newArray(Class<?> componentType, int length)
      Creates a new array of the specified component type and length.
      Type Parameters:
      T - the type of the array elements
      Parameters:
      componentType - the class of the component type of the array
      length - the length of the new array
      Returns:
      a new array of the specified component type and length
      Throws:
      NegativeArraySizeException - if the specified length is negative
      See Also:
    • newArray

      @SafeVarargs public static <T> T newArray(Class<?> componentType, int... dimensions) throws IllegalArgumentException, NegativeArraySizeException
      Creates a new array of the specified component type and dimensions.
      Type Parameters:
      T - the type of the array elements
      Parameters:
      componentType - the class of the component type of the array
      dimensions - the dimensions of the new array
      Returns:
      a new array of the specified component type and dimensions
      Throws:
      IllegalArgumentException - if the specified component type is null or if the dimensions are invalid
      NegativeArraySizeException - if any of the specified dimensions are negative
      See Also:
    • newArrayList

      public static <T> ArrayList<T> newArrayList()
      Creates a new instance of an ArrayList.
      Type Parameters:
      T - the type of elements in the list
      Returns:
      a new instance of an ArrayList
    • newArrayList

      public static <T> ArrayList<T> newArrayList(int initialCapacity)
      Creates a new instance of an ArrayList with the specified initial capacity.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      initialCapacity - the initial capacity of the list
      Returns:
      a new instance of an ArrayList with the specified initial capacity
      See Also:
    • newArrayList

      public static <T> ArrayList<T> newArrayList(Collection<? extends T> c)
      Creates a new instance of an ArrayList with the elements from the specified collection.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      c - the collection whose elements are to be placed into this list
      Returns:
      a new instance of an ArrayList containing the elements from the specified collection
      See Also:
    • newLinkedList

      public static <T> LinkedList<T> newLinkedList()
      Creates a new instance of a LinkedList.
      Type Parameters:
      T - the type of elements in the list
      Returns:
      a new instance of a LinkedList
    • newLinkedList

      public static <T> LinkedList<T> newLinkedList(Collection<? extends T> c)
      Creates a new instance of a LinkedList with the elements from the specified collection.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      c - the collection whose elements are to be placed into this list
      Returns:
      a new instance of a LinkedList containing the elements from the specified collection
      See Also:
    • newHashSet

      public static <T> Set<T> newHashSet()
      Creates a new instance of a HashSet.
      Type Parameters:
      T - the type of elements in the set
      Returns:
      a new instance of a HashSet
    • newHashSet

      public static <T> Set<T> newHashSet(int initialCapacity)
      Creates a new instance of a HashSet with the specified initial capacity.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      initialCapacity - the initial capacity of the set
      Returns:
      a new instance of a HashSet with the specified initial capacity
      See Also:
    • newHashSet

      public static <T> Set<T> newHashSet(Collection<? extends T> c)
      Creates a new instance of a HashSet with the elements from the specified collection.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      c - the collection whose elements are to be placed into this set
      Returns:
      a new instance of a HashSet containing the elements from the specified collection
      See Also:
    • newLinkedHashSet

      public static <T> Set<T> newLinkedHashSet()
      Creates a new instance of HashSet.
      Type Parameters:
      T - the type of elements in the set
      Returns:
      a new instance of a HashSet
    • newLinkedHashSet

      public static <T> Set<T> newLinkedHashSet(int initialCapacity)
      Creates a new instance of a LinkedHashSet with the specified initial capacity.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      initialCapacity - the initial capacity of the set
      Returns:
      a new instance of a LinkedHashSet with the specified initial capacity
      See Also:
    • newLinkedHashSet

      public static <T> Set<T> newLinkedHashSet(Collection<? extends T> c)
      Creates a new instance of a LinkedHashSet with the elements from the specified collection.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      c - the collection whose elements are to be placed into this set
      Returns:
      a new instance of a LinkedHashSet containing the elements from the specified collection
      See Also:
    • newTreeSet

      public static <T extends Comparable<? super T>> TreeSet<T> newTreeSet()
      Creates a new instance of TreeSet.
      Type Parameters:
      T - the type of elements in the set
      Returns:
      a new instance of a TreeSet
    • newTreeSet

      public static <T> TreeSet<T> newTreeSet(Comparator<? super T> comparator)
      Creates a new instance of a TreeSet with the specified comparator.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      comparator - the comparator that will be used to order this set.
      Returns:
      a new instance of a TreeSet
      See Also:
    • newTreeSet

      public static <T extends Comparable<? super T>> TreeSet<T> newTreeSet(Collection<? extends T> c)
      Creates a new instance of a TreeSet with the elements from the specified collection.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      c - the collection whose elements are to be placed into this set
      Returns:
      a new instance of a TreeSet containing the elements from the specified collection
      See Also:
    • newTreeSet

      public static <T> TreeSet<T> newTreeSet(SortedSet<T> c)
      Creates a new instance of a TreeSet with the elements from the specified sorted set.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      c - the sorted set whose elements are to be placed into this set
      Returns:
      a new instance of a TreeSet containing the elements from the specified sorted set
      See Also:
    • newConcurrentHashSet

      public static <T> Set<T> newConcurrentHashSet()
      Creates a new instance of a concurrent hash set by ConcurrentHashMap.
      Type Parameters:
      T - the type of elements in the set
      Returns:
      a new instance of a concurrent hash set
      See Also:
    • newConcurrentHashSet

      public static <T> Set<T> newConcurrentHashSet(int initialCapacity)
      Creates a new instance of a concurrent hash set with the specified initial capacity.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      initialCapacity - the initial capacity of the set
      Returns:
      a new instance of a concurrent hash set
      See Also:
    • newConcurrentHashSet

      public static <T> Set<T> newConcurrentHashSet(Collection<? extends T> c)
      Creates a new instance of a concurrent hash set with the elements from the specified collection.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      c - the collection whose elements are to be placed into this set
      Returns:
      a new instance of a concurrent hash set containing the elements from the specified collection
      See Also:
    • newSetFromMap

      public static <E> Set<E> newSetFromMap(Map<E,Boolean> map)
      Returns a set backed by the specified map.
      Type Parameters:
      E - the type of elements in the set
      Parameters:
      map - the backing map
      Returns:
      a set backed by the specified map
      See Also:
    • newMultiset

      public static <T> Multiset<T> newMultiset()
      Creates a new instance of a Multiset.
      Type Parameters:
      T - the type of elements in the multiset
      Returns:
      a new instance of a Multiset
    • newMultiset

      public static <T> Multiset<T> newMultiset(int initialCapacity)
      Creates a new instance of a Multiset with the specified initial capacity.
      Type Parameters:
      T - the type of elements in the multiset
      Parameters:
      initialCapacity - the initial capacity of the multiset
      Returns:
      a new instance of a Multiset with the specified initial capacity
    • newMultiset

      public static <T> Multiset<T> newMultiset(Class<? extends Map> valueMapType)
      Creates a new instance of a Multiset with the specified backed Map type for storing element/occurrence pairs.
      Type Parameters:
      T - the type of elements in the multiset
      Parameters:
      valueMapType - the class of the map to be used to store element/occurrence pairs
      Returns:
      a new instance of a Multiset with the specified value map type
    • newMultiset

      public static <T> Multiset<T> newMultiset(Supplier<? extends Map<T,?>> mapSupplier)
      Creates a new instance of a Multiset with the specified Supplier which provides the map to store element/occurrence pairs.
      Type Parameters:
      T - the type of elements in the multiset
      Parameters:
      mapSupplier - the supplier that provides the map to be used to store element/occurrence pairs
      Returns:
      a new instance of a Multiset with the specified value map type
    • newMultiset

      public static <T> Multiset<T> newMultiset(Collection<? extends T> c)
      Creates a new instance of a Multiset with the elements from the specified collection.
      Type Parameters:
      T - the type of elements in the multiset
      Parameters:
      c - the collection whose elements are to be placed into this multiset
      Returns:
      a new instance of a Multiset containing the elements from the specified collection
    • newArrayDeque

      public static <T> ArrayDeque<T> newArrayDeque()
      Creates a new instance of an ArrayDeque.
      Type Parameters:
      T - the type of elements in the deque
      Returns:
      a new instance of an ArrayDeque
    • newArrayDeque

      public static <T> ArrayDeque<T> newArrayDeque(int numElements)
      Creates a new instance of an ArrayDeque with the specified initial capacity.
      Type Parameters:
      T - the type of elements in the deque
      Parameters:
      numElements - the initial capacity of the deque
      Returns:
      a new instance of an ArrayDeque with the specified initial capacity
    • newArrayDeque

      public static <E> ArrayDeque<E> newArrayDeque(Collection<? extends E> c)
      Creates a new instance of an ArrayDeque with the elements from the specified collection.
      Type Parameters:
      E - the type of elements in the deque
      Parameters:
      c - the collection whose elements are to be placed into this deque
      Returns:
      a new instance of an ArrayDeque containing the elements from the specified collection
    • newEntry

      public static <K, V> Map.Entry<K,V> newEntry(K key, V value)
      Creates a new entry with the specified key and value.
      Type Parameters:
      K - the type of keys maintained by this entry
      V - the type of mapped values
      Parameters:
      key - the key to be associated with the entry
      value - the value to be associated with the entry
      Returns:
      a new entry with the specified key and value
    • newImmutableEntry

      public static <K, V> ImmutableEntry<K,V> newImmutableEntry(K key, V value)
      Creates a new immutable entry with the specified key and value.
      Type Parameters:
      K - the type of keys maintained by this entry
      V - the type of mapped values
      Parameters:
      key - the key to be associated with the entry
      value - the value to be associated with the entry
      Returns:
      a new immutable entry with the specified key and value
    • newHashMap

      public static <K, V> Map<K,V> newHashMap()
      Creates a new instance of a HashMap.
      Type Parameters:
      K - the type of keys maintained by this map
      V - the type of mapped values
      Returns:
      a new instance of a HashMap
    • newHashMap

      public static <K, V> Map<K,V> newHashMap(int initialCapacity)
      Creates a new instance of a HashMap with the specified initial capacity.
      Type Parameters:
      K - the type of keys maintained by this map
      V - the type of mapped values
      Parameters:
      initialCapacity - the initial capacity of the map
      Returns:
      a new instance of a HashMap with the specified initial capacity
    • newHashMap

      public static <K, V> Map<K,V> newHashMap(Map<? extends K,? extends V> m)
      Creates a new instance of a HashMap with the entries from the specified map.
      Type Parameters:
      K - the type of keys maintained by this map
      V - the type of mapped values
      Parameters:
      m - the map whose elements are to be placed into this map
      Returns:
      a new instance of a HashMap containing the entries from the specified map
    • newHashMap

      public static <K, V> Map<K,V> newHashMap(Collection<? extends V> c, Function<? super V,? extends K> keyExtractor) throws IllegalArgumentException
      Creates a new instance of a HashMap with the elements from the specified collection.
      Type Parameters:
      K - the type of keys maintained by this map
      V - the type of mapped values
      Parameters:
      c - the collection whose elements are to be placed into this map
      keyExtractor - the function to extract a key from a collection element
      Returns:
      a new instance of a HashMap containing the elements from the specified collection
      Throws:
      IllegalArgumentException
      See Also:
    • newLinkedHashMap

      public static <K, V> Map<K,V> newLinkedHashMap()
      Creates a new instance of a LinkedHashMap.
      Type Parameters:
      K - the type of keys maintained by this map
      V - the type of mapped values
      Returns:
      a new instance of a LinkedHashMap
    • newLinkedHashMap

      public static <K, V> Map<K,V> newLinkedHashMap(int initialCapacity)
      Creates a new instance of a LinkedHashMap with the specified initial capacity.
      Type Parameters:
      K - the type of keys maintained by this map
      V - the type of mapped values
      Parameters:
      initialCapacity - the initial capacity of the map
      Returns:
      a new instance of a LinkedHashMap with the specified initial capacity
    • newLinkedHashMap

      public static <K, V> Map<K,V> newLinkedHashMap(Map<? extends K,? extends V> m)
      Creates a new instance of a LinkedHashMap with the entries from the specified map.
      Type Parameters:
      K - the type of keys maintained by this map
      V - the type of mapped values
      Parameters:
      m - the map whose elements are to be placed into this map
      Returns:
      a new instance of a LinkedHashMap containing the entries from the specified map
    • newLinkedHashMap

      public static <K, V> Map<K,V> newLinkedHashMap(Collection<? extends V> c, Function<? super V,? extends K> keyExtractor) throws IllegalArgumentException
      Creates a new instance of a LinkedHashMap with the elements from the specified collection.
      Type Parameters:
      K - the type of keys maintained by this map
      V - the type of mapped values
      Parameters:
      c - the collection whose elements are to be placed into this map
      keyExtractor - the function to extract a key from a collection element
      Returns:
      a new instance of a LinkedHashMap containing the elements from the specified collection
      Throws:
      IllegalArgumentException
      See Also:
    • newTreeMap

      public static <K extends Comparable<? super K>, V> TreeMap<K,V> newTreeMap()
      Creates a new instance of a TreeMap.
      Type Parameters:
      K - the type of keys maintained by this map, which must be comparable
      V - the type of mapped values
      Returns:
      a new instance of a TreeMap
    • newTreeMap

      public static <C, K extends C, V> TreeMap<K,V> newTreeMap(Comparator<C> comparator)
      Creates a new instance of a TreeMap with the specified comparator.
      Type Parameters:
      C - the type of the comparator
      K - the type of keys maintained by this map
      V - the type of mapped values
      Parameters:
      comparator - the comparator that will be used to order this map
      Returns:
      a new instance of a TreeMap with the specified comparator
    • newTreeMap

      public static <K extends Comparable<? super K>, V> TreeMap<K,V> newTreeMap(Map<? extends K,? extends V> m)
      Creates a new instance of a TreeMap with the entries from the specified map.
      Type Parameters:
      K - the type of keys maintained by this map, which must be comparable
      V - the type of mapped values
      Parameters:
      m - the map whose elements are to be placed into this map
      Returns:
      a new instance of a TreeMap containing the entries from the specified map
    • newTreeMap

      public static <K, V> TreeMap<K,V> newTreeMap(SortedMap<K,? extends V> m)
      Creates a new instance of a TreeMap with the entries from the specified sorted map.
      Type Parameters:
      K - the type of keys maintained by this map
      V - the type of mapped values
      Parameters:
      m - the sorted map whose elements are to be placed into this map
      Returns:
      a new instance of a TreeMap containing the entries from the specified sorted map
    • newIdentityHashMap

      public static <K, V> IdentityHashMap<K,V> newIdentityHashMap()
      Creates a new instance of an IdentityHashMap.
      Type Parameters:
      K - the type of keys maintained by this map
      V - the type of mapped values
      Returns:
      a new instance of an IdentityHashMap
    • newIdentityHashMap

      public static <K, V> IdentityHashMap<K,V> newIdentityHashMap(int initialCapacity)
      Creates a new instance of an IdentityHashMap with the specified initial capacity.
      Type Parameters:
      K - the type of keys maintained by this map
      V - the type of mapped values
      Parameters:
      initialCapacity - the initial capacity of the map
      Returns:
      a new instance of an IdentityHashMap with the specified initial capacity
    • newIdentityHashMap

      public static <K, V> IdentityHashMap<K,V> newIdentityHashMap(Map<? extends K,? extends V> m)
      Creates a new instance of an IdentityHashMap with the entries from the specified map.
      Type Parameters:
      K - the type of keys maintained by this map
      V - the type of mapped values
      Parameters:
      m - the map whose elements are to be placed into this map
      Returns:
      a new instance of an IdentityHashMap containing the entries from the specified map
    • newConcurrentHashMap

      public static <K, V> ConcurrentHashMap<K,V> newConcurrentHashMap()
      Creates a new instance of a ConcurrentHashMap.
      Type Parameters:
      K - the type of keys maintained by this map
      V - the type of mapped values
      Returns:
      a new instance of a ConcurrentHashMap
    • newConcurrentHashMap

      public static <K, V> ConcurrentHashMap<K,V> newConcurrentHashMap(int initialCapacity)
      Creates a new instance of a ConcurrentHashMap with the specified initial capacity.
      Type Parameters:
      K - the type of keys maintained by this map
      V - the type of mapped values
      Parameters:
      initialCapacity - the initial capacity of the map
      Returns:
      a new instance of a ConcurrentHashMap with the specified initial capacity
    • newConcurrentHashMap

      public static <K, V> ConcurrentHashMap<K,V> newConcurrentHashMap(Map<? extends K,? extends V> m)
      Creates a new instance of a ConcurrentHashMap with the entries from the specified map.
      Type Parameters:
      K - the type of keys maintained by this map
      V - the type of mapped values
      Parameters:
      m - the map whose elements are to be placed into this map
      Returns:
      a new instance of a ConcurrentHashMap containing the entries from the specified map
    • newBiMap

      public static <K, V> BiMap<K,V> newBiMap()
      Creates a new instance of a BiMap.
      Type Parameters:
      K - the type of keys maintained by this map
      V - the type of mapped values
      Returns:
      a new instance of a BiMap
    • newBiMap

      public static <K, V> BiMap<K,V> newBiMap(int initialCapacity)
      Creates a new instance of a BiMap with the specified initial capacity.
      Type Parameters:
      K - the type of keys maintained by this map
      V - the type of mapped values
      Parameters:
      initialCapacity - the initial capacity of the map
      Returns:
      a new instance of a BiMap with the specified initial capacity
    • newBiMap

      public static <K, V> BiMap<K,V> newBiMap(int initialCapacity, float loadFactor)
      Creates a new instance of a BiMap with the specified initial capacity and load factor.
      Type Parameters:
      K - the type of keys maintained by this map
      V - the type of mapped values
      Parameters:
      initialCapacity - the initial capacity of the map
      loadFactor - the load factor of the map
      Returns:
      a new instance of a BiMap with the specified initial capacity and load factor
    • newBiMap

      public static <K, V> BiMap<K,V> newBiMap(Class<? extends Map> keyMapType, Class<? extends Map> valueMapType)
      Creates a new instance of a BiMap with the specified key map type which is used to create map to store key/value pairs and value map type which is used to create map to store value/key pairs.
      Type Parameters:
      K - the type of keys maintained by this map
      V - the type of mapped values
      Parameters:
      keyMapType - the class of the map to be used to store key/value pairs
      valueMapType - the class of the map to be used to store value/key pairs
      Returns:
      a new instance of a BiMap with the specified key and value map types
    • newBiMap

      public static <K, V> BiMap<K,V> newBiMap(Supplier<? extends Map<K,V>> keyMapSupplier, Supplier<? extends Map<V,K>> valueMapSupplier)
      Creates a new instance of a BiMap with the specified key map supplier which provides the map to store key/value pairs and value map supplier which provides the map to store value/key pairs.
      Type Parameters:
      K - the type of keys maintained by this map
      V - the type of mapped values
      Parameters:
      keyMapSupplier - the supplier that provides the map to store key/value pairs
      valueMapSupplier - the supplier that provides the map to store value/key pairs
      Returns:
      a new instance of a BiMap with the specified key and value map suppliers
    • newMultimap

      public static <K, E, V extends Collection<E>> Multimap<K,E,V> newMultimap(Supplier<? extends Map<K,V>> mapSupplier, Supplier<? extends V> valueSupplier)
      Creates a new instance of a Multimap with the specified map which provides the map to store key/value pairs and value supplier which provides the collection to store values.
      Type Parameters:
      K - the type of keys maintained by this map
      E - the type of elements in the collection
      V - the type of collection that holds the elements
      Parameters:
      mapSupplier - the supplier that provides the map to store key/value pairs
      valueSupplier - the supplier that provides the collection to store values
      Returns:
      a new instance of a Multimap with the specified map and value suppliers
    • newListMultimap

      public static <K, E> ListMultimap<K,E> newListMultimap()
      Creates a new instance of a ListMultimap.
      Type Parameters:
      K - the type of keys maintained by this map
      E - the type of elements in the collection
      Returns:
      a new instance of a ListMultimap
    • newListMultimap

      public static <K, E> ListMultimap<K,E> newListMultimap(int initialCapacity)
      Creates a new instance of a ListMultimap with the specified initial capacity.
      Type Parameters:
      K - the type of keys maintained by this map
      E - the type of elements in the collection
      Parameters:
      initialCapacity - the initial capacity of the ListMultimap
      Returns:
      a new instance of a ListMultimap with the specified initial capacity
    • newListMultimap

      public static <K, E> ListMultimap<K,E> newListMultimap(Class<? extends Map> mapType)
      Creates a new instance of a ListMultimap with the specified map type which is used to create the backed map for storing entries.
      Type Parameters:
      K - the type of keys maintained by this map
      E - the type of elements in the collection
      Parameters:
      mapType - the class of the map to be used to store entries
      Returns:
      a new instance of a ListMultimap with the specified map type
    • newListMultimap

      public static <K, E> ListMultimap<K,E> newListMultimap(Class<? extends Map> mapType, Class<? extends List> valueType)
      Creates a new instance of a ListMultimap with the specified map type which is used to create the backed map for storing entries and value type which is used to create the backed list for storing values.
      Type Parameters:
      K - the type of keys maintained by this map
      E - the type of elements in the collection
      Parameters:
      mapType - the class of the map to be used to store entries
      valueType - the class of the list to be used to store values
      Returns:
      a new instance of a ListMultimap with the specified map type and value type
    • newListMultimap

      public static <K, E> ListMultimap<K,E> newListMultimap(Supplier<? extends Map<K,List<E>>> mapSupplier, Supplier<? extends List<E>> valueSupplier)
      Creates a new instance of a ListMultimap with the specified map and value suppliers.
      Type Parameters:
      K - the type of keys maintained by this map
      E - the type of elements in the collection
      Parameters:
      mapSupplier - the supplier that provides the map to store entries
      valueSupplier - the supplier that provides the list to store values
      Returns:
      a new instance of a ListMultimap with the specified map and value suppliers
    • newListMultimap

      public static <K, E> ListMultimap<K,E> newListMultimap(Map<? extends K,? extends E> m)
      Creates a new instance of a ListMultimap with the entries from the specified map.
      Type Parameters:
      K - the type of keys maintained by this map
      E - the type of elements in the collection
      Parameters:
      m - the map whose elements are to be placed into this ListMultimap
      Returns:
      a new instance of a ListMultimap containing the entries from the specified map
    • newListMultimap

      public static <T, K> ListMultimap<K,T> newListMultimap(Collection<? extends T> c, Function<? super T,? extends K> keyExtractor)
      Creates a new instance of a ListMultimap with the keys extracted from the specified collection by the specified Function and values from the specified collection.
      Type Parameters:
      T - the type of elements in the collection
      K - the type of keys maintained by this map
      Parameters:
      c - the collection whose elements are to be placed into this ListMultimap
      keyExtractor - the function to extract keys from the specified collection elements
      Returns:
      a new instance of a ListMultimap with the keys extracted from the specified collection elements
    • newListMultimap

      public static <T, K, E> ListMultimap<K,E> newListMultimap(Collection<? extends T> c, Function<? super T,? extends K> keyExtractor, Function<? super T,? extends E> valueExtractor)
      Creates a new instance of a ListMultimap with the keys and values extracted from the specified collection.
      Type Parameters:
      T - the type of elements in the collection
      K - the type of keys maintained by this map
      E - the type of elements in the collection
      Parameters:
      c - the collection whose elements are to be placed into this ListMultimap
      keyExtractor - the function to extract keys from the collection elements
      valueExtractor - the function to extract values from the collection elements
      Returns:
      a new instance of a ListMultimap with the keys and values extracted from the specified collection
    • newLinkedListMultimap

      public static <K, E> ListMultimap<K,E> newLinkedListMultimap()
      Creates a new instance of a ListMultimap backed by a LinkedHashMap.
      Type Parameters:
      K - the type of keys maintained by this map
      E - the type of elements in the collection
      Returns:
      a new instance of a ListMultimap backed by a LinkedHashMap
    • newLinkedListMultimap

      public static <K, E> ListMultimap<K,E> newLinkedListMultimap(int initialCapacity)
      Creates a new instance of a ListMultimap backed by a LinkedHashMap with the specified initial capacity.
      Type Parameters:
      K - the type of keys maintained by this map
      E - the type of elements in the collection
      Parameters:
      initialCapacity - the initial capacity of the ListMultimap
      Returns:
      a new instance of a ListMultimap backed by a LinkedHashMap with the specified initial capacity
    • newLinkedListMultimap

      public static <K, E> ListMultimap<K,E> newLinkedListMultimap(Map<? extends K,? extends E> m)
      Creates a new instance of a ListMultimap backed by a LinkedHashMap with the entries from the specified map.
      Type Parameters:
      K - the type of keys maintained by this map
      E - the type of elements in the collection
      Parameters:
      m - the map whose elements are to be placed into this ListMultimap
      Returns:
      a new instance of a ListMultimap containing the entries from the specified map
    • newSortedListMultimap

      public static <K extends Comparable<? super K>, E> ListMultimap<K,E> newSortedListMultimap()
      Creates a new instance of a ListMultimap backed by a SortedMap. The keys in the map will be sorted according to their natural ordering.
      Type Parameters:
      K - the type of keys maintained by this map, which must be comparable
      E - the type of elements in the collection
      Returns:
      a new instance of a ListMultimap backed by a SortedMap
    • newSortedListMultimap

      public static <K extends Comparable<? super K>, E> ListMultimap<K,E> newSortedListMultimap(Map<? extends K,? extends E> m)
      Creates a new instance of a ListMultimap backed by a SortedMap with the entries from the specified map. The keys in the map will be sorted according to their natural ordering.
      Type Parameters:
      K - the type of keys maintained by this map, which must be comparable
      E - the type of elements in the collection
      Parameters:
      m - the map whose elements are to be placed into this ListMultimap
      Returns:
      a new instance of a ListMultimap containing the entries from the specified map
    • newSetMultimap

      public static <K, E> SetMultimap<K,E> newSetMultimap()
      Creates a new instance of a SetMultimap.
      Type Parameters:
      K - the type of keys maintained by this map
      E - the type of elements in the collection
      Returns:
      a new instance of a SetMultimap
    • newSetMultimap

      public static <K, E> SetMultimap<K,E> newSetMultimap(int initialCapacity)
      Creates a new instance of a SetMultimap with the specified initial capacity.
      Type Parameters:
      K - the type of keys maintained by this map
      E - the type of elements in the collection
      Parameters:
      initialCapacity - the initial capacity of the SetMultimap
      Returns:
      a new instance of a SetMultimap with the specified initial capacity
    • newSetMultimap

      public static <K, E> SetMultimap<K,E> newSetMultimap(Class<? extends Map> mapType)
      Creates a new instance of a SetMultimap with the specified map type which is used to create the backed map for storing entries.
      Type Parameters:
      K - the type of keys maintained by this map
      E - the type of elements in the collection
      Parameters:
      mapType - the class of the map to be used to store entries
      Returns:
      a new instance of a SetMultimap with the specified map type
    • newSetMultimap

      public static <K, E> SetMultimap<K,E> newSetMultimap(Class<? extends Map> mapType, Class<? extends Set> valueType)
      Creates a new instance of a SetMultimap with the specified map type which is used to create the backed map for storing entries and value type which is used to create the backed Set for storing values.
      Type Parameters:
      K - the type of keys maintained by this map
      E - the type of elements in the collection
      Parameters:
      mapType - the class of the map to be used to store entries
      valueType - the class of the set to be used to store values
      Returns:
      a new instance of a SetMultimap with the specified map type and value type
    • newSetMultimap

      public static <K, E> SetMultimap<K,E> newSetMultimap(Supplier<? extends Map<K,Set<E>>> mapSupplier, Supplier<? extends Set<E>> valueSupplier)
      Creates a new instance of a SetMultimap with the specified map and value suppliers.
      Type Parameters:
      K - the type of keys maintained by this map
      E - the type of elements in the collection
      Parameters:
      mapSupplier - the supplier that provides the map to store entries
      valueSupplier - the supplier that provides the set to store values
      Returns:
      a new instance of a SetMultimap with the specified map and value suppliers
    • newSetMultimap

      public static <K, E> SetMultimap<K,E> newSetMultimap(Map<? extends K,? extends E> m)
      Creates a new instance of a SetMultimap with the entries from the specified map.
      Type Parameters:
      K - the type of keys maintained by this map
      E - the type of elements in the collection
      Parameters:
      m - the map whose elements are to be placed into this SetMultimap
      Returns:
      a new instance of a SetMultimap containing the entries from the specified map
    • newSetMultimap

      public static <T, K> SetMultimap<K,T> newSetMultimap(Collection<? extends T> c, Function<? super T,? extends K> keyExtractor)
      Creates a new instance of a SetMultimap with the keys extracted from the specified collection by the specified Function and values from the specified collection.
      Type Parameters:
      T - the type of elements in the collection
      K - the type of keys maintained by this map
      Parameters:
      c - the collection whose elements are to be placed into this SetMultimap
      keyExtractor - the function to extract keys from the specified collection elements
      Returns:
      a new instance of a SetMultimap with the keys extracted from the specified collection elements
    • newSetMultimap

      public static <T, K, E> SetMultimap<K,E> newSetMultimap(Collection<? extends T> c, Function<? super T,? extends K> keyExtractor, Function<? super T,? extends E> valueExtractor)
      Creates a new instance of a SetMultimap with the keys and values extracted from the specified collection.
      Type Parameters:
      T - the type of elements in the collection
      K - the type of keys maintained by this map
      E - the type of elements in the collection
      Parameters:
      c - the collection whose elements are to be placed into this SetMultimap
      keyExtractor - the function to extract keys from the collection elements
      valueExtractor - the function to extract values from the collection elements
      Returns:
      a new instance of a SetMultimap with the keys and values extracted from the specified collection
    • newLinkedSetMultimap

      public static <K, E> SetMultimap<K,E> newLinkedSetMultimap()
      Creates a new instance of a SetMultimap backed by a LinkedHashMap.
      Type Parameters:
      K - the type of keys maintained by this map
      E - the type of elements in the collection
      Returns:
      a new instance of a SetMultimap backed by a LinkedHashMap
    • newLinkedSetMultimap

      public static <K, E> SetMultimap<K,E> newLinkedSetMultimap(int initialCapacity)
      Creates a new instance of a SetMultimap backed by a LinkedHashMap with the specified initial capacity.
      Type Parameters:
      K - the type of keys maintained by this map
      E - the type of elements in the collection
      Parameters:
      initialCapacity - the initial capacity of the SetMultimap
      Returns:
      a new instance of a SetMultimap backed by a LinkedHashMap with the specified initial capacity
    • newLinkedSetMultimap

      public static <K, E> SetMultimap<K,E> newLinkedSetMultimap(Map<? extends K,? extends E> m)
      Creates a new instance of a SetMultimap backed by a LinkedHashMap with the entries from the specified map.
      Type Parameters:
      K - the type of keys maintained by this map
      E - the type of elements in the collection
      Parameters:
      m - the map whose elements are to be placed into this SetMultimap
      Returns:
      a new instance of a SetMultimap containing the entries from the specified map
    • newSortedSetMultimap

      public static <K extends Comparable<? super K>, E> SetMultimap<K,E> newSortedSetMultimap()
      Creates a new instance of a SetMultimap backed by a SortedMap. The keys in the map will be sorted according to their natural ordering.
      Type Parameters:
      K - the type of keys maintained by this map, which must be comparable
      E - the type of elements in the collection
      Returns:
      a new instance of a SetMultimap backed by a SortedMap
    • newSortedSetMultimap

      public static <K extends Comparable<? super K>, E> SetMultimap<K,E> newSortedSetMultimap(Map<? extends K,? extends E> m)
      Creates a new instance of a SetMultimap backed by a SortedMap with the entries from the specified map. The keys in the map will be sorted according to their natural ordering.
      Type Parameters:
      K - the type of keys maintained by this map, which must be comparable
      E - the type of elements in the collection
      Parameters:
      m - the map whose elements are to be placed into this SetMultimap
      Returns:
      a new instance of a SetMultimap containing the entries from the specified map
    • newEmptyDataSet

      public static DataSet newEmptyDataSet()
      Creates a new empty DataSet. The DataSet is a data structure that stores data in a tabular format, similar to a table in a database. This method creates a DataSet with no rows or columns.
      Returns:
      A new empty DataSet.
      See Also:
    • newEmptyDataSet

      public static DataSet newEmptyDataSet(Collection<String> columnNames)
      Creates a new empty DataSet with the specified column names. The DataSet is a data structure that stores data in a tabular format, similar to a table in a database. This method creates a DataSet with no rows, but with the specified column names.
      Parameters:
      columnNames - A collection of strings representing the names of the columns in the DataSet.
      Returns:
      A new empty DataSet with the specified column names.
      See Also:
    • newEmptyDataSet

      public static DataSet newEmptyDataSet(Collection<String> columnNames, Map<String,Object> properties)
      Creates a new empty DataSet with the specified column names and properties. The DataSet is a data structure that stores data in a tabular format, similar to a table in a database. This method creates a DataSet with no rows, but with the specified column names and properties.
      Parameters:
      columnNames - A collection of strings representing the names of the columns in the DataSet.
      properties - A map representing the properties of the DataSet. The keys are property names and the values are the corresponding property values.
      Returns:
      A new empty DataSet with the specified column names and properties.
      See Also:
    • newDataSet

      public static DataSet newDataSet(Collection<?> rows) throws IllegalArgumentException
      Creates a new DataSet with the specified rows. The DataSet is a data structure that stores data in a tabular format, similar to a table in a database. The rows parameter is a collection where each item represents a row in the DataSet.
      Parameters:
      rows - A collection of objects representing the data in the DataSet. Each object is a row which can be: Map/Bean.
      Returns:
      A new DataSet with the specified rows.
      Throws:
      IllegalArgumentException - If the provided rows do not align properly.
      See Also:
    • newDataSet

      public static DataSet newDataSet(Collection<?> rows, Map<String,Object> properties) throws IllegalArgumentException
      Creates a new DataSet with the specified rows and properties. The DataSet is a data structure that stores data in a tabular format, similar to a table in a database. The rows parameter is a collection where each item represents a row in the DataSet. The properties parameter is a map where each entry represents a property of the DataSet.
      Parameters:
      rows - A collection of objects representing the data in the DataSet. Each object is a row which can be: Map/Bean.
      properties - A map of properties for the DataSet. Each key is a property name and each value is the property value.
      Returns:
      A new DataSet with the specified rows and properties.
      Throws:
      IllegalArgumentException - If the provided rows and properties do not align properly.
      See Also:
    • newDataSet

      public static DataSet newDataSet(Collection<String> columnNames, Collection<?> rows) throws IllegalArgumentException
      Creates a new DataSet with the specified column names and rows. The DataSet is a data structure that stores data in a tabular format, similar to a table in a database. Each item in the columnNames collection represents a column in the DataSet. The rows parameter is a collection where each item represents a row in the DataSet. The order of elements in each row should correspond to the order of column names.
      Parameters:
      columnNames - A collection of strings representing the names of the columns in the DataSet.
      rows - A collection of objects representing the data in the DataSet. Each object is a row which can be: Map/Bean/Array/List.
      Returns:
      A new DataSet with the specified column names and rows.
      Throws:
      IllegalArgumentException - If the length of columnNames is zero or not align with row list.
      See Also:
    • newDataSet

      public static DataSet newDataSet(Collection<String> columnNames, Collection<?> rows, Map<String,Object> properties) throws IllegalArgumentException
      Creates a new DataSet with the specified column names, rows, and properties. The DataSet is a data structure that stores data in a tabular format, similar to a table in a database. Each item in the columnNames collection represents a column in the DataSet. The rows parameter is a collection where each item represents a row in the DataSet. The order of elements in each row should correspond to the order of column names. The properties parameter is a map where each entry represents a property of the DataSet.
      Parameters:
      columnNames - A collection of strings representing the names of the columns in the DataSet.
      rows - A collection of objects representing the data in the DataSet. Each object is a row which can be: Map/Bean/Array/List.
      properties - A map of properties for the DataSet. Each key is a property name and each value is the property value.
      Returns:
      A new DataSet with the specified column names, rows, and properties.
      Throws:
      IllegalArgumentException - If the length of columnNames is zero or not align with row list.
      See Also:
    • newDataSet

      public static DataSet newDataSet(Collection<String> columnNames, Object[][] rowList) throws IllegalArgumentException
      Creates a new DataSet with the specified column names and rows. The DataSet is a data structure that stores data in a tabular format, similar to a table in a database. Each item in the columnNames collection represents a column in the DataSet. The rowList parameter is a 2D array where each sub-array represents a row in the DataSet. The order of elements in each row should correspond to the order of column names.
      Parameters:
      columnNames - A collection of strings representing the names of the columns in the DataSet.
      rowList - A 2D array of objects representing the data in the DataSet. Each sub-array is a row.
      Returns:
      A new DataSet with the specified column names and rows.
      Throws:
      IllegalArgumentException - If the length of columnNames is zero or not equal to the length of the sub-arrays in rowList.
      See Also:
    • newDataSet

      public static DataSet newDataSet(String keyColumnName, String valueColumnName, Map<?,?> m)
      Creates a new DataSet from the provided Map. The DataSet will have two columns: one for keys and one for values from the Map.
      Parameters:
      keyColumnName - The name of the column for the keys from the Map.
      valueColumnName - The name of the column for the values from the Map.
      m - The Map to convert into a DataSet.
      Returns:
      A new DataSet with two columns: one for keys and one for values from the Map.
    • newDataSet

      public static <C extends Collection<?>> DataSet newDataSet(Map<String,C> map)
      Creates a new DataSet from the provided Map. The DataSet will have as many columns as there are entries in the Map. The column names are the keys from the Map. Each column corresponds to a Collection in the Map. If a column has fewer rows than the maximum number of rows, the missing rows will be filled with null values. Eventually all the columns will have the same number of rows.
      Type Parameters:
      C - The type of the Collection values in the Map.
      Parameters:
      map - The Map to convert into a DataSet. The keys of the map represent the column names and the values (which are collections) represent the data in the columns.
      Returns:
      A new DataSet with columns created from the Map.
    • newDataSet

      public static DataSet newDataSet(String columnName, Collection<?> column) throws IllegalArgumentException
      Creates a new DataSet with single column from the provided Collection. The DataSet will have one column with the provided column name. The data in the column is the data from the provided Collection.
      Parameters:
      columnName - The name of the column in the DataSet.
      column - The Collection to convert into a DataSet column.
      Returns:
      A new DataSet with one column containing the data from the provided Collection.
      Throws:
      IllegalArgumentException - if the provided columnName is empty.
    • merge

      public static DataSet merge(@NotNull DataSet a, @NotNull DataSet b) throws IllegalArgumentException
      Merges two given DataSets into a single DataSet.
      Parameters:
      a - The first DataSet to be merged.
      b - The second DataSet to be merged.
      Returns:
      A new DataSet which is the result of merging DataSet a and DataSet b.
      Throws:
      IllegalArgumentException - if either a or b is null.
    • merge

      Merges three given DataSets into a single DataSet.
      Parameters:
      a - The first DataSet to be merged.
      b - The second DataSet to be merged.
      c - The third DataSet to be merged.
      Returns:
      A new DataSet which is the result of merging DataSet a, b and c.
      Throws:
      IllegalArgumentException - if either a, b or c is null.
    • merge

      public static DataSet merge(Collection<? extends DataSet> dss) throws IllegalArgumentException
      Merges a collection of DataSets into a single DataSet.
      Parameters:
      dss - The collection of DataSets to be merged.
      Returns:
      A new DataSet which is the result of merging all the DataSets in the provided collection.
      Throws:
      IllegalArgumentException - if the provided collection is null.
    • merge

      public static DataSet merge(Collection<? extends DataSet> dss, boolean requiresSameColumns) throws IllegalArgumentException
      Merges a collection of DataSets into a single DataSet.
      Parameters:
      dss - The collection of DataSets to be merged.
      requiresSameColumns - A boolean flag that indicates whether the DataSets in the collection should have the same columns. If set to true, all DataSets in the collection must have the same columns. If set to false, the DataSets in the collection can have different columns.
      Returns:
      A new DataSet which is the result of merging all the DataSets in the provided collection.
      Throws:
      IllegalArgumentException - if the provided collection is null or requiresSameColumns is true and the DataSets in dss don't have the same the same column names.
    • toArray

      public static Object[] toArray(Collection<?> c)
      Converts the specified collection to an array. Returns an empty array if the specified collection is null or empty.
      Parameters:
      c - the collection to be converted to an array
      Returns:
      an array containing all the elements in the specified collection
    • toArray

      public static Object[] toArray(Collection<?> c, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Converts the specified range in the specified collection into an array.
      Parameters:
      c - The collection to be converted into an array.
      fromIndex - The starting (inclusive) index of the range to be converted.
      toIndex - The ending (exclusive) index of the range to be converted.
      Returns:
      An array containing the elements of the specified range of the collection.
      Throws:
      IndexOutOfBoundsException - if the provided indices are out of the collection's range.
    • toArray

      public static <A, T extends A> A[] toArray(Collection<? extends T> c, @NotNull A[] a) throws IndexOutOfBoundsException, IllegalArgumentException
      Converts a collection into an array. If the provided array is large enough to hold the elements of the collection, it is filled with the collection's elements, otherwise, a new array of the same runtime type is allocated for this purpose.
      Type Parameters:
      A - The type of the array.
      T - The type of the elements in the collection. It must extend or be the same as the type of the array.
      Parameters:
      c - The collection to be converted into an array.
      a - The array into which the elements of the collection are to be stored, if it is big enough; otherwise, a new array of the same runtime type is allocated for this purpose.
      Returns:
      The array containing the elements of the collection. If the provided array was large enough to hold the collection's elements, it is the same as the provided array.
      Throws:
      IllegalArgumentException - if the specified Array is null.
      IndexOutOfBoundsException
    • toArray

      public static <A, T extends A> A[] toArray(Collection<? extends T> c, int fromIndex, int toIndex, @NotNull A[] a) throws IllegalArgumentException
      Converts the specified range in the specified collection into an array. If the provided array is large enough to hold the elements of the collection, it is filled with the collection's elements, otherwise, a new array of the same runtime type is allocated for this purpose.
      Type Parameters:
      A - The type of the array.
      T - The type of the elements in the collection. It must extend or be the same as the type of the array.
      Parameters:
      c - The collection to be converted into an array.
      fromIndex - The starting (inclusive) index of the range to be converted.
      toIndex - The ending (exclusive) index of the range to be converted.
      a - The array into which the elements of the collection are to be stored, if it is big enough; otherwise, a new array of the same runtime type is allocated for this purpose.
      Returns:
      The array containing the elements of the specified portion of the collection. If the provided array was large enough to hold the collection's elements, it is the same as the provided array.
      Throws:
      IllegalArgumentException - if the specified Array is null.
    • toArray

      public static <A, T extends A> A[] toArray(Collection<? extends T> c, IntFunction<A[]> arraySupplier)
      Converts a collection into an array using a provided array supplier function. The array supplier function is responsible for creating a new array of the appropriate type and size.
      Type Parameters:
      A - The type of the array.
      T - The type of the elements in the collection. It must extend or be the same as the type of the array.
      Parameters:
      c - The collection to be converted into an array.
      arraySupplier - The function to generate a new array of the appropriate type and size.
    • toArray

      public static <A, T extends A> A[] toArray(Collection<? extends T> c, int fromIndex, int toIndex, IntFunction<A[]> arraySupplier) throws IndexOutOfBoundsException
      Converts the specified range in the specified collection into an array using a provided array supplier function. The array supplier function is responsible for creating a new array of the appropriate type and size.
      Type Parameters:
      A - The type of the array.
      T - The type of the elements in the collection. It must extend or be the same as the type of the array.
      Parameters:
      c - The collection to be converted into an array.
      fromIndex - The starting (inclusive) index of the portion to be converted.
      toIndex - The ending (exclusive) index of the portion to be converted.
      arraySupplier - The function to generate a new array of the appropriate type and size.
      Returns:
      The array containing the elements of the specified portion of the collection.
      Throws:
      IndexOutOfBoundsException - if the specified fromIndex or toIndex is out of the collection's range.
    • toArray

      public static <A, T extends A> A[] toArray(Collection<? extends T> c, @NotNull Class<A[]> targetType) throws IndexOutOfBoundsException, IllegalArgumentException
      Converts a collection into an array of a specified type.
      Type Parameters:
      A - The type of the array.
      T - The type of the elements in the collection. It must extend or be the same as the type of the array.
      Parameters:
      c - The collection to be converted into an array.
      targetType - The Class object representing the type of the array to be returned.
      Returns:
      The array containing the elements of the collection.
      Throws:
      IllegalArgumentException - if the specified Class is null.
      IndexOutOfBoundsException
    • toArray

      public static <A, T extends A> A[] toArray(Collection<? extends T> c, int fromIndex, int toIndex, @NotNull Class<A[]> targetType) throws IllegalArgumentException
      Converts the specified range in the specified collection into an array of a specified type.
      Type Parameters:
      A - The type of the array.
      T - The type of the elements in the collection. It must extend or be the same as the type of the array.
      Parameters:
      c - The collection to be converted into an array.
      fromIndex - The starting (inclusive) index of the range to be converted.
      toIndex - The ending (exclusive) index of the range to be converted.
      targetType - The Class object representing the type of the array to be returned.
      Returns:
      The array containing the elements of the specified portion of the collection.
      Throws:
      IllegalArgumentException - if the specified Class is null.
      IndexOutOfBoundsException - if the specified fromIndex or toIndex is out of the collection's range.
    • toBooleanArray

      public static boolean[] toBooleanArray(Collection<Boolean> c)
      Converts a collection of Boolean objects to a boolean array.
      Parameters:
      c - the collection of Boolean objects to be converted
      Returns:
      a boolean array containing the primitive boolean values from the collection
    • toBooleanArray

      public static boolean[] toBooleanArray(Collection<Boolean> c, int fromIndex, int toIndex)
      Converts the specified range of the specified Boolean collection to a boolean array.
      Parameters:
      c - the collection of Boolean objects to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      Returns:
      a boolean array containing the primitive boolean values from the specified range of the collection
    • toBooleanArray

      public static boolean[] toBooleanArray(Collection<Boolean> c, boolean defaultForNull)
      Converts a collection of Boolean objects to a boolean array.
      Parameters:
      c - the collection of Boolean objects to be converted
      defaultForNull - the default boolean value to use if a Boolean object in the collection is null
      Returns:
      a boolean array containing the primitive boolean values from the collection
    • toBooleanArray

      public static boolean[] toBooleanArray(Collection<Boolean> c, int fromIndex, int toIndex, boolean defaultForNull) throws IndexOutOfBoundsException
      Converts the specified range of the specified Boolean collection to a boolean array.
      Parameters:
      c - the collection of Boolean objects to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      defaultForNull - the default boolean value to use if a Boolean object in the collection is null
      Returns:
      a boolean array containing the primitive boolean values from the specified range of the collection
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the collection's range
    • toBooleanArray

      public static boolean[] toBooleanArray(byte[] a)
      Converts a byte array to a boolean array. Each byte with positive value(> 0) is converted to a boolean value true, 0 and negative value to false.
      Parameters:
      a - the byte array to be converted
      Returns:
      a boolean array with the same length as the input array, or an empty boolean array if the input array is null or empty
    • toBooleanArray

      public static boolean[] toBooleanArray(int[] a)
      Converts an integer array to a boolean array. Each integer with positive value(> 0) is converted to a boolean value true, 0 and negative value to false.
      Parameters:
      a - the integer array to be converted
      Returns:
      a boolean array with the same length as the input array, or an empty boolean array if the input array is null or empty
    • toCharArray

      public static char[] toCharArray(Collection<Character> c)
      Converts a collection of Character objects to a char array.
      Parameters:
      c - the collection of Character objects to be converted
      Returns:
      a char array containing the primitive char values from the collection
    • toCharArray

      public static char[] toCharArray(Collection<Character> c, int fromIndex, int toIndex)
      Converts the specified range of the specified character collection to a char array.
      Parameters:
      c - the collection of Character objects to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      Returns:
      a char array containing the primitive char values from the specified range of the collection
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the collection's range
    • toCharArray

      public static char[] toCharArray(Collection<Character> c, char defaultForNull)
      Converts a collection of Character objects to a char array.
      Parameters:
      c - the collection of Character objects to be converted
      defaultForNull - the default char value to use if a Character object in the collection is null
      Returns:
      a char array containing the primitive char values from the collection
    • toCharArray

      public static char[] toCharArray(Collection<Character> c, int fromIndex, int toIndex, char defaultForNull) throws IndexOutOfBoundsException
      Converts the specified range of the specified character collection to a char array.
      Parameters:
      c - the collection of Character objects to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      defaultForNull - the default char value to use if a Character object in the collection is null
      Returns:
      a char array containing the primitive char values from the specified range of the collection
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the collection's range
    • toByteArray

      public static byte[] toByteArray(Collection<? extends Number> c)
      Converts a collection of Number objects to a byte array.
      Parameters:
      c - the collection of Number objects to be converted
      Returns:
      a byte array containing the primitive byte values from the collection
    • toByteArray

      public static byte[] toByteArray(Collection<? extends Number> c, int fromIndex, int toIndex)
      Converts the specified range of the specified Number collection to a byte array.
      Parameters:
      c - the collection of Number objects to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      Returns:
      a byte array containing the primitive byte values from the specified range of the collection
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the collection's range
    • toByteArray

      public static byte[] toByteArray(Collection<? extends Number> c, byte defaultForNull)
      Converts a collection of Number objects to a byte array.
      Parameters:
      c - the collection of Number objects to be converted
      defaultForNull - the default byte value to use if a Number object in the collection is null
      Returns:
      a byte array containing the primitive byte values from the collection
    • toByteArray

      public static byte[] toByteArray(Collection<? extends Number> c, int fromIndex, int toIndex, byte defaultForNull) throws IndexOutOfBoundsException
      Converts the specified range of the specified Number collection to a byte array.
      Parameters:
      c - the collection of Number objects to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      defaultForNull - the default byte value to use if a Number object in the collection is null
      Returns:
      a byte array containing the primitive byte values from the specified range of the collection
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the collection's range
    • toByteArray

      public static byte[] toByteArray(boolean[] a)
      Converts a boolean array to a byte array. Each boolean value is converted to a byte value: true to 1 and false to 0.
      Parameters:
      a - the boolean array to be converted
      Returns:
      a byte array with the same length as the input array, or an empty byte array if the input array is null or empty
    • toShortArray

      public static short[] toShortArray(Collection<? extends Number> c)
      Converts a collection of Number objects to a short array.
      Parameters:
      c - the collection of Number objects to be converted
      Returns:
      a short array containing the primitive short values from the collection
    • toShortArray

      public static short[] toShortArray(Collection<? extends Number> c, int fromIndex, int toIndex)
      Converts the specified range of the specified Number collection to a short array.
      Parameters:
      c - the collection of Number objects to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      Returns:
      a short array containing the primitive short values from the specified range of the collection
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the collection's range
    • toShortArray

      public static short[] toShortArray(Collection<? extends Number> c, short defaultForNull)
      Converts a collection of Number objects to a short array.
      Parameters:
      c - the collection of Number objects to be converted
      defaultForNull - the default short value to use if a Number object in the collection is null
      Returns:
      a short array containing the primitive short values from the collection
    • toShortArray

      public static short[] toShortArray(Collection<? extends Number> c, int fromIndex, int toIndex, short defaultForNull) throws IndexOutOfBoundsException
      Converts the specified range of the specified Number collection to a short array.
      Parameters:
      c - the collection of Number objects to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      defaultForNull - the default short value to use if a Number object in the collection is null
      Returns:
      a short array containing the primitive short values from the specified range of the collection
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the collection's range
    • toIntArray

      public static int[] toIntArray(Collection<? extends Number> c)
      Converts a collection of Number objects to an int array.
      Parameters:
      c - the collection of Number objects to be converted
      Returns:
      an int array containing the primitive int values from the collection
    • toIntArray

      public static int[] toIntArray(Collection<? extends Number> c, int fromIndex, int toIndex)
      Converts the specified range of the specified Number collection to an int array.
      Parameters:
      c - the collection of Number objects to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      Returns:
      an int array containing the primitive int values from the specified range of the collection
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the collection's range
    • toIntArray

      public static int[] toIntArray(Collection<? extends Number> c, int defaultForNull)
      Converts a collection of Number objects to an int array.
      Parameters:
      c - the collection of Number objects to be converted
      defaultForNull - the default int value to use if a Number object in the collection is null
      Returns:
      an int array containing the primitive int values from the collection
    • toIntArray

      public static int[] toIntArray(Collection<? extends Number> c, int fromIndex, int toIndex, int defaultForNull) throws IndexOutOfBoundsException
      Converts the specified range of the specified Number collection to an int array.
      Parameters:
      c - the collection of Number objects to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      defaultForNull - the default int value to use if a Number object in the collection is null
      Returns:
      an int array containing the primitive int values from the specified range of the collection
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the collection's range
    • toIntArray

      public static int[] toIntArray(char[] a)
      Converts a char array to an int array. Each char value is converted to its corresponding int value.
      Parameters:
      a - the char array to be converted
      Returns:
      an int array with the same length as the input array, or an empty byte array if the input array is null or empty
    • toIntArray

      public static int[] toIntArray(boolean[] a)
      Converts a boolean array to an int array. Each boolean value is converted to an int value: true to 1 and false to 0.
      Parameters:
      a - the boolean array to be converted
      Returns:
      an int array with the same length as the input array, or an empty byte array if the input array is null or empty
    • toLongArray

      public static long[] toLongArray(Collection<? extends Number> c)
      Converts a collection of Number objects to a long array.
      Parameters:
      c - the collection of Number objects to be converted
      Returns:
      a long array containing the primitive long values from the collection
    • toLongArray

      public static long[] toLongArray(Collection<? extends Number> c, int fromIndex, int toIndex)
      Converts the specified range of the specified Number collection to a long array.
      Parameters:
      c - the collection of Number objects to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      Returns:
      a long array containing the primitive long values from the specified range of the collection
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the collection's range
    • toLongArray

      public static long[] toLongArray(Collection<? extends Number> c, long defaultForNull)
      Converts a collection of Number objects to a long array.
      Parameters:
      c - the collection of Number objects to be converted
      defaultForNull - the default long value to use if a Number object in the collection is null
      Returns:
      a long array containing the primitive long values from the collection
    • toLongArray

      public static long[] toLongArray(Collection<? extends Number> c, int fromIndex, int toIndex, long defaultForNull) throws IndexOutOfBoundsException
      Converts the specified range of the specified Number collection to a long array.
      Parameters:
      c - the collection of Number objects to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      defaultForNull - the default long value to use if a Number object in the collection is null
      Returns:
      a long array containing the primitive long values from the specified range of the collection
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the collection's range
    • toFloatArray

      public static float[] toFloatArray(Collection<? extends Number> c)
      Converts a collection of Number objects to a float array.
      Parameters:
      c - the collection of Number objects to be converted
      Returns:
      a float array containing the primitive float values from the collection
    • toFloatArray

      public static float[] toFloatArray(Collection<? extends Number> c, int fromIndex, int toIndex)
      Converts the specified range of the specified Number collection to a float array.
      Parameters:
      c - the collection of Number objects to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      Returns:
      a float array containing the primitive float values from the specified range of the collection
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the collection's range
    • toFloatArray

      public static float[] toFloatArray(Collection<? extends Number> c, float defaultForNull)
      Converts a collection of Number objects to a float array.
      Parameters:
      c - the collection of Number objects to be converted
      defaultForNull - the default float value to use if a Number object in the collection is null
      Returns:
      a float array containing the primitive float values from the collection
    • toFloatArray

      public static float[] toFloatArray(Collection<? extends Number> c, int fromIndex, int toIndex, float defaultForNull) throws IndexOutOfBoundsException
      Converts the specified range of the specified Number collection to a float array.
      Parameters:
      c - the collection of Number objects to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      defaultForNull - the default float value to use if a Number object in the collection is null
      Returns:
      a float array containing the primitive float values from the specified range of the collection
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the collection's range
    • toDoubleArray

      public static double[] toDoubleArray(Collection<? extends Number> c)
      Converts a collection of Number objects to a double array.
      Parameters:
      c - the collection of Number objects to be converted
      Returns:
      a double array containing the primitive double values from the collection
    • toDoubleArray

      public static double[] toDoubleArray(Collection<? extends Number> c, int fromIndex, int toIndex)
      Converts the specified range of the specified Number collection to a double array.
      Parameters:
      c - the collection of Number objects to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      Returns:
      a double array containing the primitive double values from the specified range of the collection
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the collection's range
    • toDoubleArray

      public static double[] toDoubleArray(Collection<? extends Number> c, double defaultForNull)
      Converts a collection of Number objects to a double array.
      Parameters:
      c - the collection of Number objects to be converted
      defaultForNull - the default double value to use if a Number object in the collection is null
      Returns:
      a double array containing the primitive double values from the collection
    • toDoubleArray

      public static double[] toDoubleArray(Collection<? extends Number> c, int fromIndex, int toIndex, double defaultForNull) throws IndexOutOfBoundsException
      Converts the specified range of the specified Number collection to a double array.
      Parameters:
      c - the collection of Number objects to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      defaultForNull - the default double value to use if a Number object in the collection is null
      Returns:
      a double array containing the primitive double values from the specified range of the collection
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the collection's range
    • toList

      public static List<Boolean> toList(boolean[] a)
      Converts a boolean array to a modifiable List, which is NOT backed with the input array
      Parameters:
      a - the boolean array to be converted
      Returns:
      a modifiable List of Boolean objects containing the values from the boolean array
    • toList

      public static List<Boolean> toList(boolean[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Converts the specified range of the array to a modifiable List, which is NOT backed with the input array
      Parameters:
      a - the boolean array to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      Returns:
      a modifiable List of Boolean objects containing the values from the specified range of the boolean array
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the array's range
    • toList

      public static List<Character> toList(char[] a)
      Converts a char array to a modifiable List, which is NOT backed with the input array
      Parameters:
      a - the char array to be converted
      Returns:
      a modifiable List of Character objects containing the values from the char array
    • toList

      public static List<Character> toList(char[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Converts the specified range of the array to a modifiable List, which is NOT backed with the input array
      Parameters:
      a - the char array to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      Returns:
      a modifiable List of Character objects containing the values from the specified range of the char array
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the array's range
    • toList

      public static List<Byte> toList(byte[] a)
      Converts a byte array to a modifiable List, which is NOT backed with the input array
      Parameters:
      a - the byte array to be converted
      Returns:
      a modifiable List of Byte objects containing the values from the byte array
    • toList

      public static List<Byte> toList(byte[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Converts the specified range of the byte array to a modifiable List, which is NOT backed with the input array
      Parameters:
      a - the byte array to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      Returns:
      a modifiable List of Byte objects containing the values from the specified range of the byte array
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the array's range
    • toList

      public static List<Short> toList(short[] a)
      Converts a short array to a modifiable List, which is NOT backed with the input array
      Parameters:
      a - the short array to be converted
      Returns:
      a modifiable List of Short objects containing the values from the short array
    • toList

      public static List<Short> toList(short[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Converts the specified range of the short array to a modifiable List, which is NOT backed with the input array
      Parameters:
      a - the short array to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      Returns:
      a modifiable List of Short objects containing the values from the specified range of the short array
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the array's range
    • toList

      public static List<Integer> toList(int[] a)
      Converts an int array to a modifiable List, which is NOT backed with the input array
      Parameters:
      a - the int array to be converted
      Returns:
      a modifiable List of Integer objects containing the values from the int array
    • toList

      public static List<Integer> toList(int[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Converts the specified range of the int array to a modifiable List, which is NOT backed with the input array
      Parameters:
      a - the int array to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      Returns:
      a modifiable List of Integer objects containing the values from the specified range of the int array
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the array's range
    • toList

      public static List<Long> toList(long[] a)
      Converts a long array to a modifiable List, which is NOT backed with the input array
      Parameters:
      a - the long array to be converted
      Returns:
      a modifiable List of Long objects containing the values from the long array
    • toList

      public static List<Long> toList(long[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Converts the specified range of the long array to a modifiable List, which is NOT backed with the input array
      Parameters:
      a - the long array to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      Returns:
      a modifiable List of Long objects containing the values from the specified range of the long array
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the array's range
    • toList

      public static List<Float> toList(float[] a)
      Converts a float array to a modifiable List, which is NOT backed with the input array
      Parameters:
      a - the float array to be converted
      Returns:
      a modifiable List of Float objects containing the values from the float array
    • toList

      public static List<Float> toList(float[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Converts the specified range of the float array to a modifiable List, which is NOT backed with the input array
      Parameters:
      a - the float array to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      Returns:
      a modifiable List of Float objects containing the values from the specified range of the float array
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the array's range
    • toList

      public static List<Double> toList(double[] a)
      Converts a double array to a modifiable List, which is NOT backed with the input array
      Parameters:
      a - the double array to be converted
      Returns:
      a modifiable List of Double objects containing the values from the double array
    • toList

      public static List<Double> toList(double[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Converts the specified range of the double array to a modifiable List, which is NOT backed with the input array
      Parameters:
      a - the double array to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      Returns:
      a modifiable List of Double objects containing the values from the specified range of the double array
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the array's range
    • toList

      public static <T> List<T> toList(T[] a)
      Converts an array of objects to a modifiable List, which is NOT backed with the input array.
      Type Parameters:
      T - the type of elements in the array
      Parameters:
      a - the array to be converted
      Returns:
      a modifiable List of objects containing the values from the array
    • toList

      public static <T> List<T> toList(T[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Converts the specified range of the array to a modifiable List, which is NOT backed with the input array.
      Type Parameters:
      T - the type of elements in the array
      Parameters:
      a - the array to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      Returns:
      a modifiable List of objects containing the values from the specified range of the array
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the array's range
    • toList

      public static <T> List<T> toList(Iterator<? extends T> iter)
      Converts an Iterator of objects to a modifiable List.
      Type Parameters:
      T - the type of elements in the iterator
      Parameters:
      iter - the iterator to be converted
      Returns:
      a modifiable List of objects containing the values from the iterator
    • toSet

      public static Set<Boolean> toSet(boolean[] a)
      Converts a boolean array to a modifiable Set, which is NOT backed with the input array.
      Parameters:
      a - the boolean array to be converted
      Returns:
      a modifiable Set of Boolean objects containing the values from the boolean array
    • toSet

      public static Set<Boolean> toSet(boolean[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Converts the specified range of the boolean array to a modifiable Set, which is NOT backed with the input array.
      Parameters:
      a - the boolean array to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      Returns:
      a modifiable Set of Boolean objects containing the values from the specified range of the boolean array
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the array's range
    • toSet

      public static Set<Character> toSet(char[] a)
      Converts a char array to a modifiable Set, which is NOT backed with the input array.
      Parameters:
      a - the char array to be converted
      Returns:
      a modifiable Set of Character objects containing the values from the char array
    • toSet

      public static Set<Character> toSet(char[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Converts the specified range of the char array to a modifiable Set, which is NOT backed with the input array.
      Parameters:
      a - the char array to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      Returns:
      a modifiable Set of Character objects containing the values from the specified range of the char array
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the array's range
    • toSet

      public static Set<Byte> toSet(byte[] a)
      Converts a byte array to a modifiable Set, which is NOT backed with the input array.
      Parameters:
      a - the byte array to be converted
      Returns:
      a modifiable Set of Byte objects containing the values from the byte array
    • toSet

      public static Set<Byte> toSet(byte[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Converts the specified range of the byte array to a modifiable Set, which is NOT backed with the input array.
      Parameters:
      a - the byte array to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      Returns:
      a modifiable Set of Byte objects containing the values from the specified range of the byte array
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the array's range
    • toSet

      public static Set<Short> toSet(short[] a)
      Converts a short array to a modifiable Set, which is NOT backed with the input array.
      Parameters:
      a - the short array to be converted
      Returns:
      a modifiable Set of Short objects containing the values from the short array
    • toSet

      public static Set<Short> toSet(short[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Converts the specified range of the short array to a modifiable Set, which is NOT backed with the input array.
      Parameters:
      a - the short array to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      Returns:
      a modifiable Set of Short objects containing the values from the specified range of the short array
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the array's range
    • toSet

      public static Set<Integer> toSet(int[] a)
      Converts an int array to a modifiable Set, which is NOT backed with the input array.
      Parameters:
      a - the int array to be converted
      Returns:
      a modifiable Set of Integer objects containing the values from the int array
    • toSet

      public static Set<Integer> toSet(int[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Converts the specified range of the int array to a modifiable Set, which is NOT backed with the input array.
      Parameters:
      a - the int array to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      Returns:
      a modifiable Set of Integer objects containing the values from the specified range of the int array
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the array's range
    • toSet

      public static Set<Long> toSet(long[] a)
      Converts a long array to a modifiable Set, which is NOT backed with the input array.
      Parameters:
      a - the long array to be converted
      Returns:
      a modifiable Set of Long objects containing the values from the long array
    • toSet

      public static Set<Long> toSet(long[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Converts the specified range of the long array to a modifiable Set, which is NOT backed with the input array.
      Parameters:
      a - the long array to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      Returns:
      a modifiable Set of Long objects containing the values from the specified range of the long array
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the array's range
    • toSet

      public static Set<Float> toSet(float[] a)
      Converts a float array to a Set of, which is NOT backed with the input array.
      Parameters:
      a - the float array to be converted
      Returns:
      a modifiable Set of Float objects containing the values from the float array
    • toSet

      public static Set<Float> toSet(float[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Converts the specified range of the float array to a modifiable Set, which is NOT backed with the input array.
      Parameters:
      a - the float array to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      Returns:
      a modifiable Set of Float objects containing the values from the specified range of the float array
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the array's range
    • toSet

      public static Set<Double> toSet(double[] a)
      Converts a double array to a modifiable Set, which is NOT backed with the input array.
      Parameters:
      a - the double array to be converted
      Returns:
      a modifiable Set of Double objects containing the values from the double array
    • toSet

      public static Set<Double> toSet(double[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Converts the specified range of the double array to a modifiable Set, which is NOT backed with the input array.
      Parameters:
      a - the double array to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      Returns:
      a modifiable Set of Double objects containing the values from the specified range of the double array
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the array's range
    • toSet

      public static <T> Set<T> toSet(T[] a)
      Converts an array of objects to a modifiable Set, which is NOT backed with the input array.
      Type Parameters:
      T - the type of elements in the array
      Parameters:
      a - the array to be converted
      Returns:
      a modifiable Set of objects containing the values from the array
    • toSet

      public static <T> Set<T> toSet(T[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Converts the specified range of the array to a modifiable Set, which is NOT backed with the input array.
      Type Parameters:
      T - the type of elements in the array
      Parameters:
      a - the array to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      Returns:
      a modifiable Set of objects containing the values from the specified range of the array
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the array's range
    • toSet

      public static <T> Set<T> toSet(Iterator<? extends T> iter)
      Converts an Iterator of objects to a modifiable Set.
      Type Parameters:
      T - the type of elements in the iterator
      Parameters:
      iter - the iterator to be converted
      Returns:
      a modifiable Set of objects containing the values from the iterator
    • toCollection

      public static <C extends Collection<Boolean>> C toCollection(boolean[] a, IntFunction<? extends C> supplier)
      Converts a boolean array to a specified type of Collection.
      Type Parameters:
      C - the type of Collection to be returned
      Parameters:
      a - the boolean array to be converted
      supplier - a function that provides a new instance of the desired Collection type
      Returns:
      a Collection of Boolean objects containing the values from the boolean array
      See Also:
    • toCollection

      public static <C extends Collection<Boolean>> C toCollection(boolean[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier) throws IndexOutOfBoundsException
      Converts the specified range of the boolean array to a specified type of Collection.
      Type Parameters:
      C - the type of Collection to be returned
      Parameters:
      a - the boolean array to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      supplier - a function that provides a new instance of the desired Collection type
      Returns:
      a Collection of Boolean objects containing the values from the specified range of the boolean array
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the array's range
      See Also:
    • toCollection

      public static <C extends Collection<Character>> C toCollection(char[] a, IntFunction<? extends C> supplier)
      Converts a char array to a specified type of Collection.
      Type Parameters:
      C - the type of Collection to be returned
      Parameters:
      a - the char array to be converted
      supplier - a function that provides a new instance of the desired Collection type
      Returns:
      a Collection of Character objects containing the values from the char array
      See Also:
    • toCollection

      public static <C extends Collection<Character>> C toCollection(char[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier) throws IndexOutOfBoundsException
      Converts the specified range of the char array to a specified type of Collection.
      Type Parameters:
      C - the type of Collection to be returned
      Parameters:
      a - the char array to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      supplier - a function that provides a new instance of the desired Collection type
      Returns:
      a Collection of Character objects containing the values from the specified range of the char array
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the array's range
      See Also:
    • toCollection

      public static <C extends Collection<Byte>> C toCollection(byte[] a, IntFunction<? extends C> supplier)
      Converts a byte array to a specified type of Collection.
      Type Parameters:
      C - the type of Collection to be returned
      Parameters:
      a - the byte array to be converted
      supplier - a function that provides a new instance of the desired Collection type
      Returns:
      a Collection of Byte objects containing the values from the byte array
      See Also:
    • toCollection

      public static <C extends Collection<Byte>> C toCollection(byte[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier) throws IndexOutOfBoundsException
      Converts the specified range of the byte array to a specified type of Collection.
      Type Parameters:
      C - the type of Collection to be returned
      Parameters:
      a - the byte array to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      supplier - a function that provides a new instance of the desired Collection type
      Returns:
      a Collection of Byte objects containing the values from the specified range of the byte array
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the array's range
      See Also:
    • toCollection

      public static <C extends Collection<Short>> C toCollection(short[] a, IntFunction<? extends C> supplier)
      Converts a short array to a specified type of Collection.
      Type Parameters:
      C - the type of Collection to be returned
      Parameters:
      a - the short array to be converted
      supplier - a function that provides a new instance of the desired Collection type
      Returns:
      a Collection of Short objects containing the values from the short
      See Also:
    • toCollection

      public static <C extends Collection<Short>> C toCollection(short[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier) throws IndexOutOfBoundsException
      Converts the specified range of the short array to a specified type of Collection.
      Type Parameters:
      C - the type of Collection to be returned
      Parameters:
      a - the short array to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      supplier - a function that provides a new instance of the desired Collection type
      Returns:
      a Collection of Short objects containing the values from the specified range of the short array
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the array's
      See Also:
    • toCollection

      public static <C extends Collection<Integer>> C toCollection(int[] a, IntFunction<? extends C> supplier)
      Converts an int array to a specified type of Collection.
      Type Parameters:
      C - the type of Collection to be returned
      Parameters:
      a - the int array to be converted
      supplier - a function that provides a new instance of the desired Collection type
      Returns:
      a Collection of Integer objects containing the values from the int array
      See Also:
    • toCollection

      public static <C extends Collection<Integer>> C toCollection(int[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier) throws IndexOutOfBoundsException
      Converts the specified range of the int array to a specified type of Collection.
      Type Parameters:
      C - the type of Collection to be returned
      Parameters:
      a - the int array to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      supplier - a function that provides a new instance of the desired Collection type
      Returns:
      a Collection of Integer objects containing the values from the specified range of the int array
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the array's range
      See Also:
    • toCollection

      public static <C extends Collection<Long>> C toCollection(long[] a, IntFunction<? extends C> supplier)
      Converts a long array to a specified type of Collection.
      Type Parameters:
      C - the type of Collection to be returned
      Parameters:
      a - the long array to be converted
      supplier - a function that provides a new instance of the desired Collection type
      Returns:
      a Collection of Long objects containing the values from the long array
      See Also:
    • toCollection

      public static <C extends Collection<Long>> C toCollection(long[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier) throws IndexOutOfBoundsException
      Converts the specified range of the long array to a specified type of Collection.
      Type Parameters:
      C - the type of Collection to be returned
      Parameters:
      a - the long array to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      supplier - a function that provides a new instance of the desired Collection type
      Returns:
      a Collection of Long objects containing the values from the specified range of the long array
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the array's
      See Also:
    • toCollection

      public static <C extends Collection<Float>> C toCollection(float[] a, IntFunction<? extends C> supplier)
      Converts a float array to a specified type of Collection.
      Type Parameters:
      C - the type of Collection to be returned
      Parameters:
      a - the float array to be converted
      supplier - a function that provides a new instance of the desired Collection type
      Returns:
      a Collection of Float objects containing the values from the float array
      See Also:
    • toCollection

      public static <C extends Collection<Float>> C toCollection(float[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier) throws IndexOutOfBoundsException
      Converts the specified range of the float array to a specified type of Collection.
      Type Parameters:
      C - the type of Collection to be returned
      Parameters:
      a - the float array to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      supplier - a function that provides a new instance of the desired Collection type
      Returns:
      a Collection of Float objects containing the values from the specified range of the float array
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the array's range
      See Also:
    • toCollection

      public static <C extends Collection<Double>> C toCollection(double[] a, IntFunction<? extends C> supplier)
      Converts a double array to a specified type of Collection.
      Type Parameters:
      C - the type of Collection to be returned
      Parameters:
      a - the double array to be converted
      supplier - a function that provides a new instance of the desired Collection type
      Returns:
      a Collection of Double objects containing the values from the double array
      See Also:
    • toCollection

      public static <C extends Collection<Double>> C toCollection(double[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier) throws IndexOutOfBoundsException
      Converts the specified range of the double array to a specified type of Collection.
      Type Parameters:
      C - the type of Collection to be returned
      Parameters:
      a - the double array to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      supplier - a function that provides a new instance of the desired Collection type
      Returns:
      a Collection of Double objects containing the values from the specified range of the double array
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the array's range
      See Also:
    • toCollection

      public static <T, C extends Collection<T>> C toCollection(T[] a, IntFunction<? extends C> supplier)
      Converts an array of objects to a specified type of Collection.
      Type Parameters:
      T - the type of elements in the array and the Collection
      C - the type of Collection to be returned
      Parameters:
      a - the array to be converted
      supplier - a function that provides a new instance of the desired Collection type
      Returns:
      a Collection of objects containing the values from the array
      See Also:
    • toCollection

      public static <T, C extends Collection<T>> C toCollection(T[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier) throws IndexOutOfBoundsException
      Converts the specified range of the array to a specified type of Collection.
      Type Parameters:
      T - the type of elements in the array and the Collection
      C - the type of Collection to be returned
      Parameters:
      a - the array to be converted
      fromIndex - the starting (inclusive) index of the range to be converted
      toIndex - the ending (exclusive) index of the range to be converted
      supplier - a function that provides a new instance of the desired Collection type
      Returns:
      a Collection of objects containing the values from the specified range of the array
      Throws:
      IndexOutOfBoundsException - if the specified indices are out of the array's range
      See Also:
    • toCollection

      public static <T, C extends Collection<T>> C toCollection(Iterable<? extends T> c, IntFunction<? extends C> supplier)
      Converts an Iterable to a specified type of Collection.
      Type Parameters:
      T - the type of elements in the Iterable and the Collection
      C - the type of Collection to be returned
      Parameters:
      c - the Iterable to be converted
      supplier - a function that provides a new instance of the desired Collection type
      Returns:
      a Collection of objects containing the values from the Iterable
      See Also:
    • toCollection

      public static <T, C extends Collection<T>> C toCollection(Iterator<? extends T> iter, Supplier<? extends C> supplier)
      Converts an Iterator to a specified type of Collection.
      Type Parameters:
      T - the type of elements in the Iterator and the Collection
      C - the type of Collection to be returned
      Parameters:
      iter - the Iterator to be converted
      supplier - a function that provides a new instance of the desired Collection type
      Returns:
      a Collection of objects containing the values from the Iterator
      See Also:
    • toMap

      public static <T, K> Map<K,T> toMap(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor)
      Converts an Iterable to a Map using a key extractor function.
      Type Parameters:
      T - the type of elements in the Iterable
      K - the type of keys in the resulting Map
      Parameters:
      c - the Iterable to be converted
      keyExtractor - a function that extracts keys from the elements of the Iterable
      Returns:
      a Map containing the elements of the Iterable, with keys extracted by the keyExtractor function
    • toMap

      public static <T, K, V> Map<K,V> toMap(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor, Function<? super T,? extends V> valueExtractor)
      Converts an Iterable to a Map using key and value extractor functions.
      Type Parameters:
      T - the type of elements in the Iterable
      K - the type of keys in the resulting Map
      V - the type of values in the resulting Map
      Parameters:
      c - the Iterable to be converted
      keyExtractor - a function that extracts keys from the elements of the Iterable
      valueExtractor - a function that extracts values from the elements of the Iterable
      Returns:
      a Map containing the elements of the Iterable, with keys and values extracted by the keyExtractor and valueExtractor functions
    • toMap

      public static <T, K, V, M extends Map<K, V>> M toMap(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor, Function<? super T,? extends V> valueExtractor, IntFunction<? extends M> mapSupplier)
      Converts an Iterable to a Map using key and value extractor functions, with a custom Map supplier.
      Type Parameters:
      T - the type of elements in the Iterable
      K - the type of keys in the resulting Map
      V - the type of values in the resulting Map
      M - the type of Map to be returned
      Parameters:
      c - the Iterable to be converted
      keyExtractor - a function that extracts keys from the elements of the Iterable
      valueExtractor - a function that extracts values from the elements of the Iterable
      mapSupplier - a function that provides a new instance of the desired Map type
      Returns:
      a Map containing the elements of the Iterable, with keys and values extracted by the keyExtractor and valueExtractor functions
    • toMap

      public static <T, K, V, M extends Map<K, V>> M toMap(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor, Function<? super T,? extends V> valueExtractor, BiFunction<? super V,? super V,? extends V> mergeFunction, IntFunction<? extends M> mapSupplier)
      Converts an Iterable to a Map using key and value extractor functions, with a custom Map supplier.
      Type Parameters:
      T - the type of elements in the Iterable
      K - the type of keys in the resulting Map
      V - the type of values in the resulting Map
      M - the type of Map to be returned
      Parameters:
      c - the Iterable to be converted
      keyExtractor - a function that extracts keys from the elements of the Iterable
      valueExtractor - a function that extracts values from the elements of the Iterable
      mapSupplier - a function that provides a new instance of the desired Map type
      Returns:
      a Map containing the elements of the Iterable, with keys and values extracted by the keyExtractor and valueExtractor functions
    • toMap

      public static <T, K> Map<K,T> toMap(Iterator<? extends T> iter, Function<? super T,K> keyExtractor)
      Converts an Iterator to a Map using a key extractor function.
      Type Parameters:
      T - the type of elements in the Iterator
      K - the type of keys in the resulting Map
      Parameters:
      iter - the Iterator to be converted
      keyExtractor - a function that extracts keys from the elements of the Iterator
      Returns:
      a Map containing the elements of the Iterator, with keys extracted by the keyExtractor function
    • toMap

      public static <T, K, V> Map<K,V> toMap(Iterator<? extends T> iter, Function<? super T,K> keyExtractor, Function<? super T,? extends V> valueExtractor)
      Converts an Iterator to a Map using key and value extractor functions.
      Type Parameters:
      T - the type of elements in the Iterator
      K - the type of keys in the resulting Map
      V - the type of values in the resulting Map
      Parameters:
      iter - the Iterator to be converted
      keyExtractor - a function that extracts keys from the elements of the Iterator
      valueExtractor - a function that extracts values from the elements of the Iterator
      Returns:
      a Map containing the elements of the Iterator, with keys and values extracted by the keyExtractor and valueExtractor functions
    • toMap

      public static <T, K, V, M extends Map<K, V>> M toMap(Iterator<? extends T> iter, Function<? super T,K> keyExtractor, Function<? super T,? extends V> valueExtractor, Supplier<? extends M> mapSupplier)
      Converts an Iterator to a Map using key and value extractor functions, with a custom Map supplier.
      Type Parameters:
      T - the type of elements in the Iterator
      K - the type of keys in the resulting Map
      V - the type of values in the resulting Map
      M - the type of Map to be returned
      Parameters:
      iter - the Iterator to be converted
      keyExtractor - a function that extracts keys from the elements of the Iterator
      valueExtractor - a function that extracts values from the elements of the Iterator
      mapSupplier - a function that provides a new instance of the desired Map type
      Returns:
      a Map containing the elements of the Iterator, with keys and values extracted by the keyExtractor and valueExtractor functions
    • toMap

      public static <T, K, V, M extends Map<K, V>> M toMap(Iterator<? extends T> iter, Function<? super T,K> keyExtractor, Function<? super T,? extends V> valueExtractor, BiFunction<? super V,? super V,? extends V> mergeFunction, Supplier<? extends M> mapSupplier)
      Converts an Iterator to a Map using key and value extractor functions, with a custom Map supplier.
      Type Parameters:
      T - the type of elements in the Iterator
      K - the type of keys in the resulting Map
      V - the type of values in the resulting Map
      M - the type of Map to be returned
      Parameters:
      iter - the Iterator to be converted
      keyExtractor - a function that extracts keys from the elements of the Iterator
      valueExtractor - a function that extracts values from the elements of the Iterator
      mergeFunction - a function that merges values if the same key is encountered
      mapSupplier - a function that provides a new instance of the desired Map type
      Returns:
      a Map containing the elements of the Iterator, with keys and values extracted by the keyExtractor and valueExtractor functions
    • asArray

      @SafeVarargs public static <T> T[] asArray(T... a)
      Returns the input array as is.
      Type Parameters:
      T - the type of the array elements
      Parameters:
      a - the input array
      Returns:
      the input array
    • asMap

      public static <K, V> Map<K,V> asMap(K k1, V v1)
      Returns a modifiable Map with the specified key and value.
      Type Parameters:
      K - the type of keys in the Map
      V - the type of values in the Map
      Parameters:
      k1 - the key to be placed in the Map
      v1 - the value to be associated with the key in the Map
      Returns:
      a Map containing the specified key and value
    • asMap

      public static <K, V> Map<K,V> asMap(K k1, V v1, K k2, V v2)
      Returns a modifiable Map with the specified keys and values.
      Type Parameters:
      K - the type of keys in the Map
      V - the type of values in the Map
      Parameters:
      k1 - the first key to be placed in the Map
      v1 - the value to be associated with the first key in the Map
      k2 - the second key to be placed in the Map
      v2 - the value to be associated with the second key in the Map
      Returns:
      a Map containing the specified keys and values
    • asMap

      public static <K, V> Map<K,V> asMap(K k1, V v1, K k2, V v2, K k3, V v3)
      Returns a modifiable Map with specified keys/values.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      k1 - the first key to be placed in the Map
      v1 - the value to be associated with the first key in the Map
      k2 - the second key to be placed in the Map
      v2 - the value to be associated with the second key in the Map
      k3 - the third key to be placed in the Map
      v3 - the value to be associated with the third key in the Map
      Returns:
      a Map containing the specified keys and values
    • asMap

      public static <K, V> Map<K,V> asMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4)
      Returns a modifiable Map with specified keys/values.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      k1 - the first key to be placed in the Map
      v1 - the value to be associated with the first key in the Map
      k2 - the second key to be placed in the Map
      v2 - the value to be associated with the second key in the Map
      k3 - the third key to be placed in the Map
      v3 - the value to be associated with the third key in the Map
      k4 - the fourth key to be placed in the Map
      v4 - the value to be associated with the fourth key in the Map
      Returns:
      a Map containing the specified keys and values
    • asMap

      public static <K, V> Map<K,V> asMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5)
      Returns a modifiable Map with specified keys/values.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      k1 - the first key to be placed in the Map
      v1 - the value to be associated with the first key in the Map
      k2 - the second key to be placed in the Map
      v2 - the value to be associated with the second key in the Map
      k3 - the third key to be placed in the Map
      v3 - the value to be associated with the third key in the Map
      k4 - the fourth key to be placed in the Map
      v4 - the value to be associated with the fourth key in the Map
      k5 - the fifth key to be placed in the Map
      v5 - the value to be associated with the fifth key in the Map
      Returns:
      a Map containing the specified keys and values
    • asMap

      public static <K, V> Map<K,V> asMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6)
      Returns a modifiable Map with specified keys/values.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      k1 - the first key to be placed in the Map
      v1 - the value to be associated with the first key in the Map
      k2 - the second key to be placed in the Map
      v2 - the value to be associated with the second key in the Map
      k3 - the third key to be placed in the Map
      v3 - the value to be associated with the third key in the Map
      k4 - the fourth key to be placed in the Map
      v4 - the value to be associated with the fourth key in the Map
      k5 - the fifth key to be placed in the Map
      v5 - the value to be associated with the fifth key in the Map
      k6 - the sixth key to be placed in the Map
      v6 - the value to be associated with the sixth key in the Map
      Returns:
      a Map containing the specified keys and values
    • asMap

      public static <K, V> Map<K,V> asMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7)
      Returns a modifiable Map with specified keys/values.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      k1 - the first key to be placed in the Map
      v1 - the value to be associated with the first key in the Map
      k2 - the second key to be placed in the Map
      v2 - the value to be associated with the second key in the Map
      k3 - the third key to be placed in the Map
      v3 - the value to be associated with the third key in the Map
      k4 - the fourth key to be placed in the Map
      v4 - the value to be associated with the fourth key in the Map
      k5 - the fifth key to be placed in the Map
      v5 - the value to be associated with the fifth key in the Map
      k6 - the sixth key to be placed in the Map
      v6 - the value to be associated with the sixth key in the Map
      k7 - the seventh key to be placed in the Map
      v7 - the value to be associated with the seventh key in the Map
      Returns:
      a Map containing the specified keys and values
    • asMap

      @Deprecated @SafeVarargs @NullSafe public static <K, V> Map<K,V> asMap(Object... a)
      Deprecated.
      Returns a modifiable Map with specified key/value pairs.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      a - an array of key/value pairs
      Returns:
      a Map containing the specified key/value pairs
    • asLinkedHashMap

      public static <K, V> Map<K,V> asLinkedHashMap(K k1, V v1)
      Returns a modifiable LinkedHashMap with specified key and value.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      k1 - the first key to be placed in the Map
      v1 - the value to be associated with the first key in the Map
      Returns:
      a Map containing the specified keys and values
    • asLinkedHashMap

      public static <K, V> Map<K,V> asLinkedHashMap(K k1, V v1, K k2, V v2)
      Returns a modifiable LinkedHashMap with specified keys/values.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      k1 - the first key to be placed in the Map
      v1 - the value to be associated with the first key in the Map
      k2 - the second key to be placed in the Map
      v2 - the value to be associated with the second key in the Map
      Returns:
      a Map containing the specified keys and values
    • asLinkedHashMap

      public static <K, V> Map<K,V> asLinkedHashMap(K k1, V v1, K k2, V v2, K k3, V v3)
      Returns a modifiable LinkedHashMap with specified keys/values.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      k1 - the first key to be placed in the Map
      v1 - the value to be associated with the first key in the Map
      k2 - the second key to be placed in the Map
      v2 - the value to be associated with the second key in the Map
      k3 - the third key to be placed in the Map
      v3 - the value to be associated with the third key in the Map
      Returns:
      a Map containing the specified keys and values
    • asLinkedHashMap

      public static <K, V> Map<K,V> asLinkedHashMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4)
      Returns a modifiable LinkedHashMap with specified keys/values.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      k1 - the first key to be placed in the Map
      v1 - the value to be associated with the first key in the Map
      k2 - the second key to be placed in the Map
      v2 - the value to be associated with the second key in the Map
      k3 - the third key to be placed in the Map
      v3 - the value to be associated with the third key in the Map
      k4 - the fourth key to be placed in the Map
      v4 - the value to be associated with the fourth key in the Map
      Returns:
      a Map containing the specified keys and values
    • asLinkedHashMap

      public static <K, V> Map<K,V> asLinkedHashMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5)
      Returns a modifiable LinkedHashMap with specified keys/values.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      k1 - the first key to be placed in the Map
      v1 - the value to be associated with the first key in the Map
      k2 - the second key to be placed in the Map
      v2 - the value to be associated with the second key in the Map
      k3 - the third key to be placed in the Map
      v3 - the value to be associated with the third key in the Map
      k4 - the fourth key to be placed in the Map
      v4 - the value to be associated with the fourth key in the Map
      k5 - the fifth key to be placed in the Map
      v5 - the value to be associated with the fifth key in the Map
      Returns:
      a Map containing the specified keys and values
    • asLinkedHashMap

      public static <K, V> Map<K,V> asLinkedHashMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6)
      Returns a modifiable LinkedHashMap with specified keys/values.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      k1 - the first key to be placed in the Map
      v1 - the value to be associated with the first key in the Map
      k2 - the second key to be placed in the Map
      v2 - the value to be associated with the second key in the Map
      k3 - the third key to be placed in the Map
      v3 - the value to be associated with the third key in the Map
      k4 - the fourth key to be placed in the Map
      v4 - the value to be associated with the fourth key in the Map
      k5 - the fifth key to be placed in the Map
      v5 - the value to be associated with the fifth key in the Map
      k6 - the sixth key to be placed in the Map
      v6 - the value to be associated with the sixth key in the Map
      Returns:
      a Map containing the specified keys and values
    • asLinkedHashMap

      public static <K, V> Map<K,V> asLinkedHashMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7)
      Returns a modifiable LinkedHashMap with specified keys/values.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      k1 - the first key to be placed in the Map
      v1 - the value to be associated with the first key in the Map
      k2 - the second key to be placed in the Map
      v2 - the value to be associated with the second key in the Map
      k3 - the third key to be placed in the Map
      v3 - the value to be associated with the third key in the Map
      k4 - the fourth key to be placed in the Map
      v4 - the value to be associated with the fourth key in the Map
      k5 - the fifth key to be placed in the Map
      v5 - the value to be associated with the fifth key in the Map
      k6 - the sixth key to be placed in the Map
      v6 - the value to be associated with the sixth key in the Map
      k7 - the seventh key to be placed in the Map
      v7 - the value to be associated with the seventh key in the Map
      Returns:
      a Map containing the specified keys and values
    • asLinkedHashMap

      @Deprecated @SafeVarargs @NullSafe public static <K, V> Map<K,V> asLinkedHashMap(Object... a)
      Deprecated.
      Returns a modifiable LinkedHashMap with specified key/value pairs.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      a - an array of key/value pairs
      Returns:
      a Map containing the specified key/value pairs
    • asProps

      @Beta public static Map<String,Object> asProps(String propName, Object propValue)
      Returns a modifiable Map with a specified key/value.
      Parameters:
      propName - the name of the property to be placed in the Map
      propValue - the value to be associated with the property name in the Map
      Returns:
      a Map containing the specified property name and value
    • asProps

      public static Map<String,Object> asProps(String propName1, Object propValue1, String propName2, Object propValue2)
      Returns a modifiable Map with specified keys/values.
      Parameters:
      propName1 - the first property name to be placed in the Map
      propValue1 - the value to be associated with the first property name in the Map
      propName2 - the second property name to be placed in the Map
      propValue2 - the value to be associated with the second property name in the Map
      Returns:
      a Map containing the specified property names and values
    • asProps

      public static Map<String,Object> asProps(String propName1, Object propValue1, String propName2, Object propValue2, String propName3, Object propValue3)
      Returns a modifiable Map with specified keys/values.
      Parameters:
      propName1 - the first property name to be placed in the Map
      propValue1 - the value to be associated with the first property name in the Map
      propName2 - the second property name to be placed in the Map
      propValue2 - the value to be associated with the second property name in the Map
      propName3 - the third property name to be placed in the Map
      propValue3 - the value to be associated with the third property name in the Map
      Returns:
      a Map containing the specified property names and values
    • asProps

      public static Map<String,Object> asProps(String propName1, Object propValue1, String propName2, Object propValue2, String propName3, Object propValue3, String propName4, Object propValue4)
      Returns a modifiable Map with specified keys/values.
      Parameters:
      propName1 - the first property name to be placed in the Map
      propValue1 - the value to be associated with the first property name in the Map
      propName2 - the second property name to be placed in the Map
      propValue2 - the value to be associated with the second property name in the Map
      propName3 - the third property name to be placed in the Map
      propValue3 - the value to be associated with the third property name in the Map
      propName4 - the fourth property name to be placed in the Map
      propValue4 - the value to be associated with the fourth property name in the Map
      Returns:
      a Map containing the specified property names and values
    • asProps

      public static Map<String,Object> asProps(String propName1, Object propValue1, String propName2, Object propValue2, String propName3, Object propValue3, String propName4, Object propValue4, String propName5, Object propValue5)
      Returns a modifiable Map with specified keys/values.
      Parameters:
      propName1 - the first property name to be placed in the Map
      propValue1 - the value to be associated with the first property name in the Map
      propName2 - the second property name to be placed in the Map
      propValue2 - the value to be associated with the second property name in the Map
      propName3 - the third property name to be placed in the Map
      propValue3 - the value to be associated with the third property name in the Map
      propName4 - the fourth property name to be placed in the Map
      propValue4 - the value to be associated with the fourth property name in the Map
      propName5 - the fifth property name to be placed in the Map
      propValue5 - the value to be associated with the fifth property name in the Map
      Returns:
      a Map containing the specified property names and values
    • asProps

      @Deprecated @SafeVarargs public static Map<String,Object> asProps(Object... a)
      Deprecated.
      Returns a modifiable Map with specified key/value pairs.
      Parameters:
      a - an array of key/value pairs
      Returns:
      a Map containing the specified key/value pairs
    • asList

      public static <T> List<T> asList(T e)
      Returns a modifiable List with the specified element.
      Type Parameters:
      T - the type of the element
      Parameters:
      e - the element to be placed in the List
      Returns:
      a List containing the specified element
    • asList

      public static <T> List<T> asList(T e1, T e2)
      Returns a modifiable List with specified elements.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      e1 - the first element to be placed in the List
      e2 - the second element to be placed in the List
      Returns:
      a List containing the specified elements
    • asList

      public static <T> List<T> asList(T e1, T e2, T e3)
      Returns a modifiable List with specified elements.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      e1 - the first element to be placed in the List
      e2 - the second element to be placed in the List
      e3 - the third element to be placed in the List
      Returns:
      a List containing the specified elements
    • asList

      public static <T> List<T> asList(T e1, T e2, T e3, T e4)
      Returns a modifiable List with specified elements.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      e1 - the first element to be placed in the List
      e2 - the second element to be placed in the List
      e3 - the third element to be placed in the List
      e4 - the fourth element to be placed in the List
      Returns:
      a List containing the specified elements
    • asList

      public static <T> List<T> asList(T e1, T e2, T e3, T e4, T e5)
      Returns a modifiable List with specified elements.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      e1 - the first element to be placed in the List
      e2 - the second element to be placed in the List
      e3 - the third element to be placed in the List
      e4 - the fourth element to be placed in the List
      e5 - the fifth element to be placed in the List
      Returns:
      a List containing the specified elements
    • asList

      public static <T> List<T> asList(T e1, T e2, T e3, T e4, T e5, T e6)
      Returns a modifiable List with specified elements.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      e1 - the first element to be placed in the List
      e2 - the second element to be placed in the List
      e3 - the third element to be placed in the List
      e4 - the fourth element to be placed in the List
      e5 - the fifth element to be placed in the List
      e6 - the sixth element to be placed in the List
      Returns:
      a List containing the specified elements
    • asList

      public static <T> List<T> asList(T e1, T e2, T e3, T e4, T e5, T e6, T e7)
      Returns a modifiable List with specified elements.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      e1 - the first element to be placed in the List
      e2 - the second element to be placed in the List
      e3 - the third element to be placed in the List
      e4 - the fourth element to be placed in the List
      e5 - the fifth element to be placed in the List
      e6 - the sixth element to be placed in the List
      e7 - the seventh element to be placed in the List
      Returns:
      a List containing the specified elements
    • asList

      public static <T> List<T> asList(T e1, T e2, T e3, T e4, T e5, T e6, T e7, T e8)
      Returns a modifiable List with specified elements.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      e1 - the first element to be placed in the List
      e2 - the second element to be placed in the List
      e3 - the third element to be placed in the List
      e4 - the fourth element to be placed in the List
      e5 - the fifth element to be placed in the List
      e6 - the sixth element to be placed in the List
      e7 - the seventh element to be placed in the List
      e8 - the eighth element to be placed in the List
      Returns:
      a List containing the specified elements
    • asList

      public static <T> List<T> asList(T e1, T e2, T e3, T e4, T e5, T e6, T e7, T e8, T e9)
      Returns a modifiable List with specified elements.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      e1 - the first element to be placed in the List
      e2 - the second element to be placed in the List
      e3 - the third element to be placed in the List
      e4 - the fourth element to be placed in the List
      e5 - the fifth element to be placed in the List
      e6 - the sixth element to be placed in the List
      e7 - the seventh element to be placed in the List
      e8 - the eighth element to be placed in the List
      e9 - the ninth element to be placed in the List
      Returns:
      a List containing the specified elements
    • asList

      @SafeVarargs @NullSafe public static <T> List<T> asList(@NullSafe T... a)
      Returns a modifiable List with specified elements. And it's not backed by the specified array. If the specified array is null or empty, an empty List is returned.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      a - the array of elements to be placed in the List
      Returns:
      a List containing the specified elements
      See Also:
    • asLinkedList

      public static <T> LinkedList<T> asLinkedList(T e)
      Returns a modifiable LinkedList with the specified element.
      Type Parameters:
      T - the type of the element
      Parameters:
      e - the element to be placed in the List
      Returns:
      a List containing the specified element
    • asLinkedList

      public static <T> LinkedList<T> asLinkedList(T e1, T e2)
      Returns a modifiable LinkedList with specified elements.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      e1 - the first element to be placed in the List
      e2 - the second element to be placed in the List
      Returns:
      a List containing the specified elements
    • asLinkedList

      public static <T> LinkedList<T> asLinkedList(T e1, T e2, T e3)
      Returns a modifiable LinkedList with specified elements.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      e1 - the first element to be placed in the List
      e2 - the second element to be placed in the List
      e3 - the third element to be placed in the List
      Returns:
      a List containing the specified elements
    • asLinkedList

      public static <T> LinkedList<T> asLinkedList(T e1, T e2, T e3, T e4)
      Returns a modifiable LinkedList with specified elements.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      e1 - the first element to be placed in the List
      e2 - the second element to be placed in the List
      e3 - the third element to be placed in the List
      e4 - the fourth element to be placed in the List
      Returns:
      a List containing the specified elements
    • asLinkedList

      public static <T> LinkedList<T> asLinkedList(T e1, T e2, T e3, T e4, T e5)
      Returns a modifiable LinkedList with specified elements.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      e1 - the first element to be placed in the List
      e2 - the second element to be placed in the List
      e3 - the third element to be placed in the List
      e4 - the fourth element to be placed in the List
      e5 - the fifth element to be placed in the List
      Returns:
      a List containing the specified elements
    • asLinkedList

      public static <T> LinkedList<T> asLinkedList(T e1, T e2, T e3, T e4, T e5, T e6)
      Returns a modifiable LinkedList with specified elements.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      e1 - the first element to be placed in the List
      e2 - the second element to be placed in the List
      e3 - the third element to be placed in the List
      e4 - the fourth element to be placed in the List
      e5 - the fifth element to be placed in the List
      e6 - the sixth element to be placed in the List
      Returns:
      a List containing the specified elements
    • asLinkedList

      public static <T> LinkedList<T> asLinkedList(T e1, T e2, T e3, T e4, T e5, T e6, T e7)
      Returns a modifiable LinkedList with specified elements.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      e1 - the first element to be placed in the List
      e2 - the second element to be placed in the List
      e3 - the third element to be placed in the List
      e4 - the fourth element to be placed in the List
      e5 - the fifth element to be placed in the List
      e6 - the sixth element to be placed in the List
      e7 - the seventh element to be placed in the List
      Returns:
      a List containing the specified elements
    • asLinkedList

      @SafeVarargs @NullSafe public static <T> LinkedList<T> asLinkedList(T... a)
      Returns a modifiable LinkedList with specified elements. And it's not backed by the specified array. If the specified array is null or empty, an empty List is returned.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      a - the array of elements to be placed in the List
      Returns:
      a List containing the specified elements
      See Also:
    • asSet

      public static <T> Set<T> asSet(T e)
      Returns a modifiable Set with the specified element.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      e - the element to be placed in the Set
      Returns:
      a Set containing the specified element
    • asSet

      public static <T> Set<T> asSet(T e1, T e2)
      Returns a modifiable Set with the specified elements.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      e1 - the first element to be placed in the Set
      e2 - the second element to be placed in the Set
      Returns:
      a Set containing the specified elements
    • asSet

      public static <T> Set<T> asSet(T e1, T e2, T e3)
      Returns a modifiable Set with the specified elements.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      e1 - the first element to be placed in the Set
      e2 - the second element to be placed in the Set
      e3 - the third element to be placed in the Set
      Returns:
      a Set containing the specified elements
    • asSet

      public static <T> Set<T> asSet(T e1, T e2, T e3, T e4)
      Returns a modifiable Set with the specified elements.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      e1 - the first element to be placed in the Set
      e2 - the second element to be placed in the Set
      e3 - the third element to be placed in the Set
      e4 - the fourth element to be placed in the Set
      Returns:
      a Set containing the specified elements
    • asSet

      public static <T> Set<T> asSet(T e1, T e2, T e3, T e4, T e5)
      Returns a modifiable Set with the specified elements.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      e1 - the first element to be placed in the Set
      e2 - the second element to be placed in the Set
      e3 - the third element to be placed in the Set
      e4 - the fourth element to be placed in the Set
      e5 - the fifth element to be placed in the Set
      Returns:
      a Set containing the specified elements
    • asSet

      public static <T> Set<T> asSet(T e1, T e2, T e3, T e4, T e5, T e6)
      Returns a modifiable Set with the specified elements.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      e1 - the first element to be placed in the Set
      e2 - the second element to be placed in the Set
      e3 - the third element to be placed in the Set
      e4 - the fourth element to be placed in the Set
      e5 - the fifth element to be placed in the Set
      e6 - the sixth element to be placed in the Set
      Returns:
      a Set containing the specified elements
    • asSet

      public static <T> Set<T> asSet(T e1, T e2, T e3, T e4, T e5, T e6, T e7)
      Returns a modifiable Set with the specified elements.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      e1 - the first element to be placed in the Set
      e2 - the second element to be placed in the Set
      e3 - the third element to be placed in the Set
      e4 - the fourth element to be placed in the Set
      e5 - the fifth element to be placed in the Set
      e6 - the sixth element to be placed in the Set
      e7 - the seventh element to be placed in the Set
      Returns:
      a Set containing the specified elements
    • asSet

      public static <T> Set<T> asSet(T e1, T e2, T e3, T e4, T e5, T e6, T e7, T e8)
      Returns a modifiable Set with the specified elements.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      e1 - the first element to be placed in the Set
      e2 - the second element to be placed in the Set
      e3 - the third element to be placed in the Set
      e4 - the fourth element to be placed in the Set
      e5 - the fifth element to be placed in the Set
      e6 - the sixth element to be placed in the Set
      e7 - the seventh element to be placed in the Set
      e8 - the eighth element to be placed in the Set
      Returns:
      a Set containing the specified elements
    • asSet

      public static <T> Set<T> asSet(T e1, T e2, T e3, T e4, T e5, T e6, T e7, T e8, T e9)
      Returns a modifiable Set with the specified elements.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      e1 - the first element to be placed in the Set
      e2 - the second element to be placed in the Set
      e3 - the third element to be placed in the Set
      e4 - the fourth element to be placed in the Set
      e5 - the fifth element to be placed in the Set
      e6 - the sixth element to be placed in the Set
      e7 - the seventh element to be placed in the Set
      e8 - the eighth element to be placed in the Set
      e9 - the ninth element to be placed in the Set
      Returns:
      a Set containing the specified elements
    • asSet

      @SafeVarargs @NullSafe public static <T> Set<T> asSet(T... a)
      Returns a modifiable Set with specified elements. And it's not backed by the specified array. If the specified array is null or empty, an empty Set is returned.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      a - the array of elements to be placed in the set
      Returns:
      a Set containing the specified elements
    • asLinkedHashSet

      public static <T> Set<T> asLinkedHashSet(T e)
      Returns a modifiable LinkedHashSet with specified element.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      e - the element to be placed in the Set
      Returns:
      a Set containing the specified element
    • asLinkedHashSet

      public static <T> Set<T> asLinkedHashSet(T e1, T e2)
      Returns a modifiable LinkedHashSet with the specified elements.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      e1 - the first element to be placed in the Set
      e2 - the second element to be placed in the Set
      Returns:
      a Set containing the specified elements
    • asLinkedHashSet

      public static <T> Set<T> asLinkedHashSet(T e1, T e2, T e3)
      Returns a modifiable LinkedHashSet with the specified elements.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      e1 - the first element to be placed in the Set
      e2 - the second element to be placed in the Set
      e3 - the third element to be placed in the Set
      Returns:
      a Set containing the specified elements
    • asLinkedHashSet

      public static <T> Set<T> asLinkedHashSet(T e1, T e2, T e3, T e4)
      Returns a modifiable LinkedHashSet with the specified elements.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      e1 - the first element to be placed in the Set
      e2 - the second element to be placed in the Set
      e3 - the third element to be placed in the Set
      e4 - the fourth element to be placed in the Set
      Returns:
      a Set containing the specified elements
    • asLinkedHashSet

      public static <T> Set<T> asLinkedHashSet(T e1, T e2, T e3, T e4, T e5)
      Returns a modifiable LinkedHashSet with the specified elements.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      e1 - the first element to be placed in the Set
      e2 - the second element to be placed in the Set
      e3 - the third element to be placed in the Set
      e4 - the fourth element to be placed in the Set
      e5 - the fifth element to be placed in the Set
      Returns:
      a Set containing the specified elements
    • asLinkedHashSet

      public static <T> Set<T> asLinkedHashSet(T e1, T e2, T e3, T e4, T e5, T e6)
      Returns a modifiable LinkedHashSet with the specified elements.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      e1 - the first element to be placed in the Set
      e2 - the second element to be placed in the Set
      e3 - the third element to be placed in the Set
      e4 - the fourth element to be placed in the Set
      e5 - the fifth element to be placed in the Set
      e6 - the sixth element to be placed in the Set
      Returns:
      a Set containing the specified elements
    • asLinkedHashSet

      public static <T> Set<T> asLinkedHashSet(T e1, T e2, T e3, T e4, T e5, T e6, T e7)
      Returns a modifiable LinkedHashSet with the specified elements.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      e1 - the first element to be placed in the Set
      e2 - the second element to be placed in the Set
      e3 - the third element to be placed in the Set
      e4 - the fourth element to be placed in the Set
      e5 - the fifth element to be placed in the Set
      e6 - the sixth element to be placed in the Set
      e7 - the seventh element to be placed in the Set
      Returns:
      a Set containing the specified elements
    • asLinkedHashSet

      @SafeVarargs @NullSafe public static <T> Set<T> asLinkedHashSet(T... a)
      Returns a modifiable LinkedHashSet with specified elements. And it's not backed by the specified array. If the specified array is null or empty, an empty LinkedHashSet is returned.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      a - the array of elements to be placed in the set
      Returns:
      a Set containing the specified elements
    • asSortedSet

      @SafeVarargs @NullSafe public static <T> SortedSet<T> asSortedSet(T... a)
      Returns a modifiable SortedSet with specified elements. And it's not backed by the specified array. If the specified array is null or empty, an empty SortedSet is returned.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      a - the array of elements to be placed in the set
      Returns:
      a Set containing the specified elements
    • asNavigableSet

      @SafeVarargs public static <T> NavigableSet<T> asNavigableSet(T... a)
      Returns a modifiable NavigableSet with specified elements. And it's not backed by the specified array. If the specified array is null or empty, an empty NavigableSet is returned.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      a - the array of elements to be placed in the set
      Returns:
      a Set containing the specified elements
    • asQueue

      @SafeVarargs public static <T> Queue<T> asQueue(T... a)
      Returns a modifiable Queue with specified elements. And it's not backed by the specified array. If the specified array is null or empty, an empty Queue is returned.
      Type Parameters:
      T - the type of elements in the queue
      Parameters:
      a - the array of elements to be placed in the queue
      Returns:
      a queue containing the specified elements
    • asArrayBlockingQueue

      @SafeVarargs public static <T> ArrayBlockingQueue<T> asArrayBlockingQueue(T... a)
      Returns a modifiable ArrayBlockingQueue with specified elements. And it's not backed by the specified array. If the specified array is null or empty, an empty ArrayBlockingQueue is returned.
      Type Parameters:
      T - the type of elements in the queue
      Parameters:
      a - the array of elements to be placed in the queue
      Returns:
      a queue containing the specified elements
    • asLinkedBlockingQueue

      @SafeVarargs public static <T> LinkedBlockingQueue<T> asLinkedBlockingQueue(T... a)
      Returns a modifiable LinkedBlockingQueue with specified elements. And it's not backed by the specified array. If the specified array is null or empty, an empty LinkedBlockingQueue is returned.
      Type Parameters:
      T - the type of elements in the queue
      Parameters:
      a - the array of elements to be placed in the queue
      Returns:
      a queue containing the specified elements
    • asConcurrentLinkedQueue

      @SafeVarargs public static <T> ConcurrentLinkedQueue<T> asConcurrentLinkedQueue(T... a)
      Returns a modifiable ConcurrentLinkedQueue with specified elements. And it's not backed by the specified array. If the specified array is null or empty, an empty ConcurrentLinkedQueue is returned.
      Type Parameters:
      T - the type of elements in the queue
      Parameters:
      a - the array of elements to be placed in the queue
      Returns:
      a queue containing the specified elements
    • asDelayQueue

      @SafeVarargs public static <T extends Delayed> DelayQueue<T> asDelayQueue(T... a)
      Returns a modifiable DelayQueue with specified elements. And it's not backed by the specified array. If the specified array is null or empty, an empty DelayQueue is returned.
      Type Parameters:
      T - the type of elements in the queue
      Parameters:
      a - the array of elements to be placed in the queue
      Returns:
      a queue containing the specified elements
    • asPriorityQueue

      @SafeVarargs public static <T> PriorityQueue<T> asPriorityQueue(T... a)
      Returns a modifiable PriorityQueue with specified elements. And it's not backed by the specified array. If the specified array is null or empty, an empty PriorityQueue is returned.
      Type Parameters:
      T - the type of elements in the queue
      Parameters:
      a - the array of elements to be placed in the queue
      Returns:
      a queue containing the specified elements
    • asDeque

      @SafeVarargs public static <T> Deque<T> asDeque(T... a)
      Returns a modifiable Deque with specified elements. And it's not backed by the specified array. If the specified array is null or empty, an empty Deque is returned.
      Type Parameters:
      T - the type of elements in the deque
      Parameters:
      a - the array of elements to be placed in the deque
      Returns:
      a deque containing the specified elements
    • asArrayDeque

      @SafeVarargs public static <T> ArrayDeque<T> asArrayDeque(T... a)
      Returns a modifiable ArrayDeque with specified elements. And it's not backed by the specified array. If the specified array is null or empty, an empty ArrayDeque is returned.
      Type Parameters:
      T - the type of elements in the deque
      Parameters:
      a - the array of elements to be placed in the deque
      Returns:
      a deque containing the specified elements
    • asLinkedBlockingDeque

      @SafeVarargs public static <T> LinkedBlockingDeque<T> asLinkedBlockingDeque(T... a)
      Returns a modifiable asLinkedBlockingDeque with specified elements. And it's not backed by the specified array. If the specified array is null or empty, an empty asLinkedBlockingDeque is returned.
      Type Parameters:
      T - the type of elements in the deque
      Parameters:
      a - the array of elements to be placed in the deque
      Returns:
      a deque containing the specified elements
    • asConcurrentLinkedDeque

      @SafeVarargs public static <T> ConcurrentLinkedDeque<T> asConcurrentLinkedDeque(T... a)
      Returns a modifiable ConcurrentLinkedDeque with specified elements. And it's not backed by the specified array. If the specified array is null or empty, an empty ConcurrentLinkedDeque is returned.
      Type Parameters:
      T - the type of elements in the deque
      Parameters:
      a - the array of elements to be placed in the deque
      Returns:
      a deque containing the specified elements
    • asMultiset

      @SafeVarargs public static <T> Multiset<T> asMultiset(T... a)
      Returns a modifiable Multiset with the specified elements. If the specified array is null or empty, an empty modifiable Multiset is returned.
      Type Parameters:
      T - the type of elements in the multiset
      Parameters:
      a - the array of elements to be placed in the multiset
      Returns:
      a Multiset containing the specified elements
    • asSingletonList

      @Immutable public static <T> List<T> asSingletonList(T e)
      Returns an immutable list containing only the specified element.
      Type Parameters:
      T - the type of the element
      Parameters:
      e - the element to be wrapped in a singleton list
      Returns:
      an immutable/unmodifiable list containing the specified element
      See Also:
    • asSingletonSet

      @Immutable public static <T> Set<T> asSingletonSet(T e)
      Returns an immutable set containing only the specified element.
      Type Parameters:
      T - the type of the element
      Parameters:
      e - the element to be wrapped in a singleton set
      Returns:
      an immutable/unmodifiable list containing the specified element
      See Also:
    • asSingletonMap

      @Immutable public static <K, V> Map<K,V> asSingletonMap(K key, V value)
      Returns an immutable map containing only the specified key-value pair.
      Type Parameters:
      K - the type of keys maintained by the map
      V - the type of mapped values
      Parameters:
      key - the key to be placed in the map
      value - the value to be associated with the key
      Returns:
      an immutable/unmodifiable map containing the specified key-value pair
      See Also:
    • emptyList

      @Immutable public static <T> List<T> emptyList()
      Returns an immutable/unmodifiable empty List.
      Type Parameters:
      T - the type of elements in the list
      Returns:
      an immutable/unmodifiable empty list
      See Also:
    • emptySet

      @Immutable public static <T> Set<T> emptySet()
      Returns an immutable/unmodifiable empty Set.
      Type Parameters:
      T - the type of elements in the set
      Returns:
      an immutable/unmodifiable empty set
      See Also:
    • emptySortedSet

      @Immutable public static <T> SortedSet<T> emptySortedSet()
      Returns an immutable/unmodifiable empty SortedSet.
      Type Parameters:
      T - the type of elements in the set
      Returns:
      an immutable/unmodifiable empty set
      See Also:
    • emptyNavigableSet

      @Immutable public static <T> NavigableSet<T> emptyNavigableSet()
      Returns an immutable/unmodifiable empty NavigableSet.
      Type Parameters:
      T - the type of elements in the set
      Returns:
      an immutable/unmodifiable empty set
      See Also:
    • emptyMap

      @Immutable public static <K, V> Map<K,V> emptyMap()
      Returns an immutable/unmodifiable empty Map.
      Type Parameters:
      K - the key type
      V - the value type
      Returns:
      an immutable/unmodifiable empty map
      See Also:
    • emptySortedMap

      @Immutable public static <K, V> SortedMap<K,V> emptySortedMap()
      Returns an immutable/unmodifiable empty SortedMap.
      Type Parameters:
      K - the key type
      V - the value type
      Returns:
      an immutable/unmodifiable empty sorted map
      See Also:
    • emptyNavigableMap

      @Immutable public static <K, V> NavigableMap<K,V> emptyNavigableMap()
      Returns an immutable/unmodifiable empty NavigableMap.
      Type Parameters:
      K - the key type
      V - the value type
      Returns:
      an immutable/unmodifiable empty navigable map
      See Also:
    • emptyIterator

      public static <T> Iterator<T> emptyIterator()
      Returns an immutable/unmodifiable empty iterator.
      Type Parameters:
      T - the type of elements returned by this iterator
      Returns:
      an immutable/unmodifiable empty iterator
      See Also:
    • emptyListIterator

      @Immutable public static <T> ListIterator<T> emptyListIterator()
      Returns an immutable/unmodifiable empty ListIterator.
      Type Parameters:
      T - the type of elements returned by this list iterator
      Returns:
      an immutable/unmodifiable empty list iterator
      See Also:
    • emptyInputStream

      @Immutable public static InputStream emptyInputStream()
      Returns an immutable/unmodifiable empty InputStream.
      Returns:
      an immutable/unmodifiable empty input stream
      See Also:
    • emptyDataSet

      @Immutable public static DataSet emptyDataSet()
      Returns an immutable/unmodifiable empty DataSet.
      Returns:
      an immutable/unmodifiable empty DataSet
      See Also:
    • getElement

      public static <T> T getElement(@NotNull Iterable<? extends T> c, int index) throws IllegalArgumentException, IndexOutOfBoundsException
      Retrieves the element at the specified position in the given Iterable.
      Type Parameters:
      T - the type of elements in the iterable
      Parameters:
      c - the iterable from which to retrieve the element
      index - the position of the element to retrieve
      Returns:
      the element at the specified position in the iterable
      Throws:
      IllegalArgumentException - if the iterable is null
      IndexOutOfBoundsException - if the index is out of range
    • getElement

      public static <T> T getElement(@NotNull Iterator<? extends T> iter, long index) throws IllegalArgumentException, IndexOutOfBoundsException
      Retrieves the element at the specified position in the given Iterator.
      Type Parameters:
      T - the type of elements in the Iterator
      Parameters:
      iter - the Iterator to retrieve the element from. Must not be null.
      index - the index of the element to retrieve. Must be a non-negative integer.
      Returns:
      the element at the specified index in the Iterator
      Throws:
      IllegalArgumentException - if the Iterator is null
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index >= size of Iterator)
    • getOnlyElement

      public static <T> u.Nullable<T> getOnlyElement(Iterable<? extends T> c) throws TooManyElementsException
      Returns the only element in the given Iterable.
      Type Parameters:
      T - the type of elements in the Iterable
      Parameters:
      c - the Iterable to get the element from
      Returns:
      a Nullable containing the only element in the Iterable if it exists, otherwise an empty Nullable
      Throws:
      TooManyElementsException - if the Iterable contains more than one element
    • getOnlyElement

      public static <T> u.Nullable<T> getOnlyElement(Iterator<? extends T> iter) throws TooManyElementsException
      Returns the only element in the given Iterator.
      Type Parameters:
      T - the type of elements in the Iterator
      Parameters:
      iter - the Iterator to get the element from
      Returns:
      a Nullable containing the only element in the Iterator if it exists, otherwise an empty Nullable
      Throws:
      TooManyElementsException - if the Iterator contains more than one element
    • firstElement

      public static <T> u.Nullable<T> firstElement(Iterable<? extends T> c)
      Returns the first element in the given Iterable wrapped in a Nullable. If the Iterable is empty, an empty Nullable is returned.
      Type Parameters:
      T - the type of elements in the Iterable
      Parameters:
      c - the Iterable to get the first element from
      Returns:
      a Nullable containing the first element in the Iterable if it exists, otherwise an empty Nullable
    • firstElement

      public static <T> u.Nullable<T> firstElement(Iterator<? extends T> iter)
      Returns the first element in the given Iterator wrapped in a Nullable. If the Iterator is empty, an empty Nullable is returned.
      Type Parameters:
      T - the type of elements in the Iterator
      Parameters:
      iter - the Iterator to get the first element from
      Returns:
      a Nullable containing the first element in the Iterator if it exists, otherwise an empty Nullable
    • lastElement

      public static <T> u.Nullable<T> lastElement(Iterable<? extends T> c)
      Returns the last element in the given Iterable wrapped in a Nullable. If the Iterable is empty, an empty Nullable is returned.
      Type Parameters:
      T - the type of elements in the Iterable
      Parameters:
      c - the Iterable to get the last element from
      Returns:
      a Nullable containing the last element in the Iterable if it exists, otherwise an empty Nullable
    • lastElement

      public static <T> u.Nullable<T> lastElement(Iterator<? extends T> iter)
      Returns the last element in the given Iterator wrapped in a Nullable. If the Iterator is empty, an empty Nullable is returned.
      Type Parameters:
      T - the type of elements in the Iterator
      Parameters:
      iter - the Iterator to get the last element from
      Returns:
      a Nullable containing the last element in the Iterator if it exists, otherwise an empty Nullable
    • firstElements

      @Beta public static <T> List<T> firstElements(Iterable<? extends T> c, int n) throws IllegalArgumentException
      Returns a list containing the first n elements from the given Iterable. If the Iterable has less than n elements, it returns a list with all the elements in the Iterable.
      Type Parameters:
      T - the type of elements in the Iterable
      Parameters:
      c - the Iterable to get the elements from
      n - the number of elements to retrieve from the Iterable
      Returns:
      a list containing the first n elements from the Iterable
      Throws:
      IllegalArgumentException - if n is negative
    • firstElements

      @Beta public static <T> List<T> firstElements(Iterator<? extends T> iter, int n) throws IllegalArgumentException
      Returns a list containing the first n elements from the given Iterator. If the Iterator has less than n elements, it returns a list with all the elements in the Iterator.
      Type Parameters:
      T - the type of elements in the Iterator
      Parameters:
      iter - the Iterator to get the elements from
      n - the number of elements to retrieve from the Iterator
      Returns:
      a list containing the first n elements from the Iterator
      Throws:
      IllegalArgumentException - if n is negative
    • lastElements

      @Beta public static <T> List<T> lastElements(Iterable<? extends T> c, int n) throws IllegalArgumentException
      Returns a list containing the last n elements from the given Iterable. If the Iterable has less than n elements, it returns a list with all the elements in the Iterable.
      Type Parameters:
      T - the type of elements in the Iterable
      Parameters:
      c - the Iterable to get the elements from
      n - the number of elements to retrieve from the end of the Iterable
      Returns:
      a list containing the last n elements from the Iterable
      Throws:
      IllegalArgumentException - if n is negative
    • lastElements

      @Beta public static <T> List<T> lastElements(Iterator<? extends T> iter, int n) throws IllegalArgumentException
      Returns a list containing the last n elements from the given Iterator. If the Iterator has less than n elements, it returns a list with all the elements in the Iterator.
      Type Parameters:
      T - the type of elements in the Iterator
      Parameters:
      iter - the Iterator to get the elements from
      n - the number of elements to retrieve from the Iterator
      Returns:
      a list containing the last n elements from the Iterator
      Throws:
      IllegalArgumentException - if n is negative
    • firstNonNull

      public static <T> u.Optional<T> firstNonNull(T a, T b)
      Returns the first non-null value among the two provided values. If both values are null, it returns an empty Optional.
      Type Parameters:
      T - the type of the values
      Parameters:
      a - the first value to check
      b - the second value to check
      Returns:
      an Optional containing the first non-null value if it exists, otherwise an empty Optional
    • firstNonNull

      public static <T> u.Optional<T> firstNonNull(T a, T b, T c)
      Returns the first non-null value among the three provided values. If all values are null, it returns an empty Optional.
      Type Parameters:
      T - the type of the values
      Parameters:
      a - the first value to check
      b - the second value to check
      c - the third value to check
      Returns:
      an Optional containing the first non-null value if it exists, otherwise an empty Optional
    • firstNonNull

      @SafeVarargs public static <T> u.Optional<T> firstNonNull(T... a)
      Returns the first non-null value among the provided values. If all values are null, it returns an empty Optional.
      Type Parameters:
      T - the type of the values
      Parameters:
      a - the array of values to check
      Returns:
      an Optional containing the first non-null value if it exists, otherwise an empty Optional
    • firstNonNull

      public static <T> u.Optional<T> firstNonNull(Iterable<? extends T> c)
      Returns the first non-null value from the provided iterable. If all values are null, it returns an empty Optional.
      Type Parameters:
      T - the type of the values
      Parameters:
      c - the iterable of values to check
      Returns:
      an Optional containing the first non-null value if it exists, otherwise an empty Optional
    • firstNonNull

      public static <T> u.Optional<T> firstNonNull(Iterator<? extends T> iter)
      Returns the first non-null value from the provided iterator. If all values are null, it returns an empty Optional.
      Type Parameters:
      T - the type of the values
      Parameters:
      iter - the iterator of values to check
      Returns:
      an Optional containing the first non-null value if it exists, otherwise an empty Optional
    • lastNonNull

      public static <T> u.Optional<T> lastNonNull(T a, T b)
      Returns the last non-null value from the provided values. If both values are null, it returns an empty Optional.
      Type Parameters:
      T - the type of the values
      Parameters:
      a - the first value to check
      b - the second value to check
      Returns:
      an Optional containing the last non-null value if it exists, otherwise an empty Optional
    • lastNonNull

      public static <T> u.Optional<T> lastNonNull(T a, T b, T c)
      Returns the last non-null value from the provided values. If all values are null, it returns an empty Optional.
      Type Parameters:
      T - the type of the values
      Parameters:
      a - the first value to check
      b - the second value to check
      c - the third value to check
      Returns:
      an Optional containing the last non-null value if it exists, otherwise an empty Optional
    • lastNonNull

      @SafeVarargs public static <T> u.Optional<T> lastNonNull(T... a)
      Returns the last non-null value from the provided array of values. If all values are null, it returns an empty Optional.
      Type Parameters:
      T - the type of the values
      Parameters:
      a - the array of values to check
      Returns:
      an Optional containing the last non-null value if it exists, otherwise an empty Optional
    • lastNonNull

      public static <T> u.Optional<T> lastNonNull(Iterable<? extends T> c)
      Returns the last non-null value from the provided iterable. If all values are null, it returns an empty Optional.
      Type Parameters:
      T - the type of the values
      Parameters:
      c - the iterable to check
      Returns:
      an Optional containing the last non-null value if it exists, otherwise an empty Optional
    • lastNonNull

      public static <T> u.Optional<T> lastNonNull(Iterator<? extends T> iter)
      Returns the last non-null value from the provided iterator. If all values are null, it returns an empty Optional.
      Type Parameters:
      T - the type of the values
      Parameters:
      iter - the iterator to check
      Returns:
      an Optional containing the last non-null value if it exists, otherwise an empty Optional
    • firstNonEmpty

      public static <T> u.Optional<T[]> firstNonEmpty(T[] a, T[] b)
      Returns the first non-empty array from the given arrays. If both arrays are empty or null, it returns an empty Optional.
      Type Parameters:
      T - the type of elements in the arrays
      Parameters:
      a - the first array to check
      b - the second array to check
      Returns:
      an Optional containing the first non-empty array, or an empty Optional if both arrays are empty or null
    • firstNonEmpty

      public static <T> u.Optional<T[]> firstNonEmpty(T[] a, T[] b, T[] c)
      Returns the first non-empty array from the given arrays. If all arrays are empty or null, it returns an empty Optional.
      Type Parameters:
      T - the type of elements in the arrays
      Parameters:
      a - the first array to check
      b - the second array to check
      c - the third array to check
      Returns:
      an Optional containing the first non-empty array, or an empty Optional if all arrays are empty or null
    • firstNonEmpty

      public static <T extends Collection<?>> u.Optional<T> firstNonEmpty(T a, T b)
      Returns the first non-empty collection from the given collections. If both collections are empty or null, it returns an empty Optional.
      Type Parameters:
      T - the type of the collections
      Parameters:
      a - the first collection to check
      b - the second collection to check
      Returns:
      an Optional containing the first non-empty collection, or an empty Optional if both collections are empty or null
    • firstNonEmpty

      public static <T extends Collection<?>> u.Optional<T> firstNonEmpty(T a, T b, T c)
      Returns the first non-empty collection from the given collections. If all collections are empty or null, it returns an empty Optional.
      Type Parameters:
      T - the type of the collections
      Parameters:
      a - the first collection to check
      b - the second collection to check
      c - the third collection to check
      Returns:
      an Optional containing the first non-empty collection, or an empty Optional if all collections are empty or null
    • firstNonEmpty

      public static <T extends CharSequence> u.Optional<T> firstNonEmpty(T a, T b)
      Returns the first non-empty CharSequence from the given CharSequences. If both CharSequences are empty or null, it returns an empty Optional.
      Type Parameters:
      T - the type of the CharSequences
      Parameters:
      a - the first CharSequence to check
      b - the second CharSequence to check
      Returns:
      an Optional containing the first non-empty CharSequence, or an empty Optional if both CharSequences are empty or null
    • firstNonEmpty

      public static <T extends CharSequence> u.Optional<T> firstNonEmpty(T a, T b, T c)
      Returns the first non-empty CharSequence from the given CharSequences. If all CharSequences are empty or null, it returns an empty Optional.
      Type Parameters:
      T - the type of the CharSequences
      Parameters:
      a - the first CharSequence to check
      b - the second CharSequence to check
      c - the third CharSequence to check
      Returns:
      an Optional containing the first non-empty CharSequence, or an empty Optional if all CharSequences are empty or null
    • firstNonEmpty

      public static <T extends CharSequence> u.Optional<T> firstNonEmpty(T... a)
      Returns the first non-empty CharSequence from the given CharSequences. If all CharSequences are empty or null, it returns an empty Optional.
      Type Parameters:
      T - the type of the CharSequences
      Parameters:
      a - the array of CharSequences to check
      Returns:
      an Optional containing the first non-empty CharSequence, or an empty Optional if all CharSequences are empty or null
    • firstNonBlank

      public static <T extends CharSequence> u.Optional<T> firstNonBlank(T a, T b)
      Returns the first non-blank CharSequence from the given CharSequences. If both CharSequences are blank or null, it returns an empty Optional.
      Type Parameters:
      T - the type of the CharSequences
      Parameters:
      a - the first CharSequence to check
      b - the second CharSequence to check
      Returns:
      an Optional containing the first non-blank CharSequence, or an empty Optional if both CharSequences are blank or null
    • firstNonBlank

      public static <T extends CharSequence> u.Optional<T> firstNonBlank(T a, T b, T c)
      Returns the first non-blank CharSequence from the given CharSequences. If all CharSequences are blank or null, it returns an empty Optional.
      Type Parameters:
      T - the type of the CharSequences
      Parameters:
      a - the first CharSequence to check
      b - the second CharSequence to check
      c - the third CharSequence to check
      Returns:
      an Optional containing the first non-blank CharSequence, or an empty Optional if all CharSequences are blank or null
    • firstNonBlank

      public static <T extends CharSequence> u.Optional<T> firstNonBlank(T... a)
      Returns the first non-blank CharSequence from the given CharSequences. If all CharSequences are blank or null, it returns an empty Optional.
      Type Parameters:
      T - the type of the CharSequences
      Parameters:
      a - the array of CharSequences to check
      Returns:
      an Optional containing the first non-blank CharSequence, or an empty Optional if all CharSequences are blank or null
    • firstEntry

      public static <K, V> u.Optional<Map.Entry<K,V>> firstEntry(Map<K,V> map)
      Returns the first entry from the given map. If the map is null or empty, it returns an empty Optional.
      Type Parameters:
      K - the type of keys maintained by the map
      V - the type of mapped values
      Parameters:
      map - the map from which to retrieve the first entry
      Returns:
      an Optional containing the first entry of the map, or an empty Optional if the map is null or empty
    • lastEntry

      public static <K, V> u.Optional<Map.Entry<K,V>> lastEntry(Map<K,V> map)
      Returns the last entry from the given map. If the map is null or empty, it returns an empty Optional.
      Type Parameters:
      K - the type of keys maintained by the map
      V - the type of mapped values
      Parameters:
      map - the map from which to retrieve the last entry
      Returns:
      an Optional containing the last entry of the map, or an empty Optional if the map is null or empty
    • firstOrNullIfEmpty

      public static <T> T firstOrNullIfEmpty(T[] a)
      Returns the first element of the given array if it is not empty, otherwise returns null.
      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the array to check
      Returns:
      the first element of the array if it is not empty, otherwise null
    • firstOrNullIfEmpty

      public static <T> T firstOrNullIfEmpty(Iterable<? extends T> c)
      Returns the first element of the given iterable if it is not empty, otherwise returns null.
      Type Parameters:
      T - the type of the elements in the iterable
      Parameters:
      c - the iterable to check
      Returns:
      the first element of the iterable if it is not empty, otherwise null
    • firstOrNullIfEmpty

      public static <T> T firstOrNullIfEmpty(Iterator<? extends T> iter)
      Returns the first element of the given iterator if it is not empty, otherwise returns null.
      Type Parameters:
      T - the type of the elements in the iterator
      Parameters:
      iter - the iterator to check
      Returns:
      the first element of the iterator if it is not empty, otherwise null
    • firstOrDefaultIfEmpty

      public static <T> T firstOrDefaultIfEmpty(T[] a, T defaultValueForEmpty)
      Returns the first element of the given array if it is not empty, otherwise returns the specified default value.
      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the array to check
      defaultValueForEmpty - the default value to return if the array is empty
      Returns:
      the first element of the array if it is not empty, otherwise the specified default value
    • firstOrDefaultIfEmpty

      public static <T> T firstOrDefaultIfEmpty(Iterable<? extends T> c, T defaultValueForEmpty)
      Returns the first element of the given iterable if it is not empty, otherwise returns the specified default value.
      Type Parameters:
      T - the type of the elements in the iterable
      Parameters:
      c - the iterable to check
      defaultValueForEmpty - the default value to return if the iterable is empty
      Returns:
      the first element of the iterable if it is not empty, otherwise the specified default value
    • firstOrDefaultIfEmpty

      public static <T> T firstOrDefaultIfEmpty(Iterator<? extends T> iter, T defaultValueForEmpty)
      Returns the first element of the given iterator if it is not empty, otherwise returns the specified default value.
      Type Parameters:
      T - the type of the elements in the iterator
      Parameters:
      iter - the iterator to check
      defaultValueForEmpty - the default value to return if the iterator is empty
      Returns:
      the first element of the iterator if it is not empty, otherwise the specified default value
    • lastOrNullIfEmpty

      public static <T> T lastOrNullIfEmpty(T[] a)
      Returns the last element of the given array if it is not empty, otherwise returns null.
      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the array to check
      Returns:
      the last element of the array if it is not empty, otherwise null
    • lastOrNullIfEmpty

      public static <T> T lastOrNullIfEmpty(Iterable<? extends T> c)
      Returns the last element of the given iterable if it is not empty, otherwise returns null.
      Type Parameters:
      T - the type of the elements in the iterable
      Parameters:
      c - the iterable to check
      Returns:
      the last element of the iterable if it is not empty, otherwise null
    • lastOrNullIfEmpty

      public static <T> T lastOrNullIfEmpty(Iterator<? extends T> iter)
      Returns the last element of the given iterator if it is not empty, otherwise returns null.
      Type Parameters:
      T - the type of the elements in the iterator
      Parameters:
      iter - the iterator to check
      Returns:
      the last element of the iterator if it is not empty, otherwise null
    • lastOrDefaultIfEmpty

      public static <T> T lastOrDefaultIfEmpty(T[] a, T defaultValueForEmpty)
      Returns the last element of the given array if it is not empty, otherwise returns the specified default value.
      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the array to check
      defaultValueForEmpty - the default value to return if the array is empty
      Returns:
      the last element of the array if it is not empty, otherwise the specified default value
    • lastOrDefaultIfEmpty

      public static <T> T lastOrDefaultIfEmpty(Iterable<? extends T> c, T defaultValueForEmpty)
      Returns the last element of the given iterable if it is not empty, otherwise returns the specified default value.
      Type Parameters:
      T - the type of the elements in the iterable
      Parameters:
      c - the iterable to check
      defaultValueForEmpty - the default value to return if the iterable is empty
      Returns:
      the last element of the iterable if it is not empty, otherwise the specified default value
    • lastOrDefaultIfEmpty

      public static <T> T lastOrDefaultIfEmpty(Iterator<? extends T> iter, T defaultValueForEmpty)
      Returns the last element of the given iterator if it is not empty, otherwise returns the specified default value.
      Type Parameters:
      T - the type of the elements in the iterator
      Parameters:
      iter - the iterator to check
      defaultValueForEmpty - the default value to return if the iterator is empty
      Returns:
      the last element of the iterator if it is not empty, otherwise the specified default value
    • findFirst

      public static <T> u.Nullable<T> findFirst(T[] a, Predicate<? super T> predicate)
      Returns the first element in the given array that matches the specified predicate.
      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the array to search
      predicate - the predicate to apply to elements of the array
      Returns:
      an Optional containing the first element that matches the predicate, or an empty Optional if no such element is found
    • findFirst

      public static <T> u.Nullable<T> findFirst(Iterable<? extends T> c, Predicate<? super T> predicate)
      Returns the first element in the given iterable that matches the specified predicate.
      Type Parameters:
      T - the type of the elements in the iterable
      Parameters:
      c - the iterable to search
      predicate - the predicate to apply to elements of the iterable
      Returns:
      an Optional containing the first element that matches the predicate, or an empty Optional if no such element is found
    • findFirst

      public static <T> u.Nullable<T> findFirst(Iterator<? extends T> iter, Predicate<? super T> predicate)
      Returns the first element in the given iterator that matches the specified predicate.
      Type Parameters:
      T - the type of the elements in the iterator
      Parameters:
      iter - the iterator to search
      predicate - the predicate to apply to elements of the iterator
      Returns:
      an Optional containing the first element that matches the predicate, or an empty Optional if no such element is found
    • findLast

      public static <T> u.Nullable<T> findLast(T[] a, Predicate<? super T> predicate)
      Returns the last element in the given array that matches the specified predicate.
      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the array to search
      predicate - the predicate to apply to elements of the array
      Returns:
      an Optional containing the last element that matches the predicate, or an empty Optional if no such element is found
    • findLast

      public static <T> u.Nullable<T> findLast(Iterable<? extends T> c, Predicate<? super T> predicate)
      Returns the last element in the given iterable that matches the specified predicate.
      Type Parameters:
      T - the type of the elements in the iterable
      Parameters:
      c - the iterable to search
      predicate - the predicate to apply to elements of the iterable
      Returns:
      an Optional containing the last element that matches the predicate, or an empty Optional if no such element is found
    • findFirstNonNull

      public static <T> u.Optional<T> findFirstNonNull(T[] a, Predicate<? super T> predicate)
      Returns the first non-null element in the given array that matches the specified predicate.
      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the array to search
      predicate - the predicate to apply to elements of the array
      Returns:
      an Optional containing the first non-null element that matches the predicate, or an empty Optional if no such element is found
    • findFirstNonNull

      public static <T> u.Optional<T> findFirstNonNull(Iterable<? extends T> c, Predicate<? super T> predicate)
      Returns the first non-null element in the given iterable that matches the specified predicate.
      Type Parameters:
      T - the type of the elements in the iterable
      Parameters:
      c - the iterable to search
      predicate - the predicate to apply to elements of the iterable
      Returns:
      an Optional containing the first non-null element that matches the predicate, or an empty Optional if no such element is found
    • findFirstNonNull

      public static <T> u.Optional<T> findFirstNonNull(Iterator<? extends T> iter, Predicate<? super T> predicate)
      Returns the first non-null element in the given iterator that matches the specified predicate.
      Type Parameters:
      T - the type of the elements in the iterator
      Parameters:
      iter - the iterator to search
      predicate - the predicate to apply to elements of the iterator
      Returns:
      an Optional containing the first non-null element that matches the predicate, or an empty Optional if no such element is found
    • findLastNonNull

      public static <T> u.Optional<T> findLastNonNull(T[] a, Predicate<? super T> predicate)
      Returns the last non-null element in the given array that matches the specified predicate.
      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the array to search
      predicate - the predicate to apply to elements of the array
      Returns:
      an Optional containing the last non-null element that matches the predicate, or an empty Optional if no such element is found
    • findLastNonNull

      public static <T> u.Optional<T> findLastNonNull(Iterable<? extends T> c, Predicate<? super T> predicate)
      Returns the last non-null element in the given iterable that matches the specified predicate.
      Type Parameters:
      T - the type of the elements in the iterable
      Parameters:
      c - the iterable to search
      predicate - the predicate to apply to elements of the iterable
      Returns:
      an Optional containing the last non-null element that matches the predicate, or an empty Optional if no such element is found
    • len

      public static int len(CharSequence s)
      Returns the length of the specified CharSequence, or 0 if it's empty or null.
      Parameters:
      s - the CharSequence to check
      Returns:
      the length of the CharSequence, or 0 if the CharSequence is null
    • len

      public static int len(boolean[] a)
      Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
      Parameters:
      a - the array to check
      Returns:
      the length of the array, or 0 if the array is null
    • len

      public static int len(char[] a)
      Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
      Parameters:
      a - the array to check
      Returns:
      the length of the array, or 0 if the array is null
    • len

      public static int len(byte[] a)
      Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
      Parameters:
      a - the array to check
      Returns:
      the length of the array, or 0 if the array is null
    • len

      public static int len(short[] a)
      Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
      Parameters:
      a - the array to check
      Returns:
      the length of the array, or 0 if the array is null
    • len

      public static int len(int[] a)
      Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
      Parameters:
      a - the array to check
      Returns:
      the length of the array, or 0 if the array is null
    • len

      public static int len(long[] a)
      Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
      Parameters:
      a - the array to check
      Returns:
      the length of the array, or 0 if the array is null
    • len

      public static int len(float[] a)
      Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
      Parameters:
      a - the array to check
      Returns:
      the length of the array, or 0 if the array is null
    • len

      public static int len(double[] a)
      Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
      Parameters:
      a - the array to check
      Returns:
      the length of the array, or 0 if the array is null
    • len

      public static int len(Object[] a)
      Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
      Parameters:
      a - the array to check
      Returns:
      the length of the array, or 0 if the array is null
    • size

      public static int size(Collection<?> c)
      Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
      Parameters:
      a - the collection to check
      Returns:
      the size of the specified collection, or 0 if the collection is null
    • size

      public static int size(Map<?,?> m)
      Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
      Parameters:
      a - the map to check
      Returns:
      the size of the specified map, or 0 if the map is null
    • size

      @Beta public static int size(PrimitiveList c)
      Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
      Parameters:
      a - the PrimitiveList to check
      Returns:
      the size of the specified PrimitiveList, or 0 if the PrimitiveList is null
    • nullToEmpty

      @Beta public static String nullToEmpty(String str)
      Converts a null string to an empty string.
      Parameters:
      str - the string to check
      Returns:
      the original string if it is not null, otherwise an empty string
      See Also:
    • nullToEmpty

      public static <T> List<T> nullToEmpty(List<T> list)
      Returns an immutable/unmodifiable empty list if the specified list is null, otherwise itself is returned.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      list - the list to check
      Returns:
      an empty list if the specified list is null, otherwise the original list
      See Also:
    • nullToEmpty

      public static <T> Set<T> nullToEmpty(Set<T> set)
      Returns an immutable/unmodifiable empty set if the specified Set is null, otherwise itself is returned.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      set - the set to check
      Returns:
      an empty set if the specified set is null, otherwise the original set
      See Also:
    • nullToEmpty

      public static <T> SortedSet<T> nullToEmpty(SortedSet<T> set)
      Returns an immutable/unmodifiable empty SortedSet if the specified SortedSet is null, otherwise itself is returned.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      set - the set to check
      Returns:
      an empty SortedSet if the specified set is null, otherwise the original set
      See Also:
    • nullToEmpty

      public static <T> NavigableSet<T> nullToEmpty(NavigableSet<T> set)
      Returns an immutable/unmodifiable empty NavigableSet if the specified NavigableSet is null, otherwise itself is returned.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      set - the set to check
      Returns:
      an empty NavigableSet if the specified set is null, otherwise the original set
      See Also:
    • nullToEmpty

      public static <T> Collection<T> nullToEmpty(Collection<T> c)
      Returns an immutable/unmodifiable empty List if the specified list is null, otherwise itself is returned.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      list - the list to check
      Returns:
      an empty List if the specified list is null, otherwise the original list
      See Also:
    • nullToEmpty

      public static <K, V> Map<K,V> nullToEmpty(Map<K,V> map)
      Returns an immutable/unmodifiable empty map if the specified Map is null, otherwise itself is returned.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      map - the map to check
      Returns:
      an empty map if the specified map is null, otherwise the original map
      See Also:
    • nullToEmpty

      public static <K, V> SortedMap<K,V> nullToEmpty(SortedMap<K,V> map)
      Returns an immutable/unmodifiable empty SortedMap if the specified SortedMap is null, otherwise itself is returned.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      map - the SortedMap to check
      Returns:
      an empty SortedMap if the specified SortedMap is null, otherwise the original SortedMap
      See Also:
    • nullToEmpty

      public static <K, V> NavigableMap<K,V> nullToEmpty(NavigableMap<K,V> map)
      Returns an immutable/unmodifiable empty NavigableMap if the specified NavigableMap is null, otherwise itself is returned.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      map - the NavigableMap to check
      Returns:
      an empty NavigableMap if the specified NavigableMap is null, otherwise the original NavigableMap
      See Also:
    • nullToEmpty

      public static <T> Iterator<T> nullToEmpty(Iterator<T> iter)
      Returns an immutable/unmodifiable empty iterator if the specified Iterator is null, otherwise itself is returned.
      Type Parameters:
      T - the type of elements returned by this iterator
      Parameters:
      iter - the iterator to check
      Returns:
      an empty iterator if the specified Iterator is null, otherwise the original Iterator
      See Also:
    • nullToEmpty

      public static <T> ListIterator<T> nullToEmpty(ListIterator<T> iter)
      Returns an immutable/unmodifiable empty ListIterator if the specified ListIterator is null, otherwise itself is returned.
      Type Parameters:
      T - the type of elements returned by this list iterator
      Parameters:
      iter - the list iterator to check
      Returns:
      an empty ListIterator if the specified ListIterator is null, otherwise the original ListIterator
      See Also:
    • nullToEmpty

      public static boolean[] nullToEmpty(boolean[] a)
      Returns an empty boolean array if the specified array is null, otherwise returns the original array.
      Parameters:
      a - the boolean array to check
      Returns:
      an empty boolean array if the specified array is null, otherwise the original array
    • nullToEmpty

      public static char[] nullToEmpty(char[] a)
      Returns an empty char array if the specified array is null, otherwise returns the original array.
      Parameters:
      a - the char array to check
      Returns:
      an empty char array if the specified array is null, otherwise the original array
    • nullToEmpty

      public static byte[] nullToEmpty(byte[] a)
      Returns an empty byte array if the specified array is null, otherwise returns the original array.
      Parameters:
      a - the byte array to check
      Returns:
      an empty byte array if the specified array is null, otherwise the original array
    • nullToEmpty

      public static short[] nullToEmpty(short[] a)
      Returns an empty short array if the specified array is null, otherwise returns the original array.
      Parameters:
      a - the short array to check
      Returns:
      an empty short array if the specified array is null, otherwise the original array
    • nullToEmpty

      public static int[] nullToEmpty(int[] a)
      Returns an empty int array if the specified array is null, otherwise returns the original array.
      Parameters:
      a - the int array to check
      Returns:
      an empty int array if the specified array is null, otherwise the original array
    • nullToEmpty

      public static long[] nullToEmpty(long[] a)
      Returns an empty long array if the specified array is null, otherwise returns the original array.
      Parameters:
      a - the long array to check
      Returns:
      an empty long array if the specified array is null, otherwise the original array
    • nullToEmpty

      public static float[] nullToEmpty(float[] a)
      Returns an empty float array if the specified array is null, otherwise returns the original array.
      Parameters:
      a - the float array to check
      Returns:
      an empty float array if the specified array is null, otherwise the original array
    • nullToEmpty

      public static double[] nullToEmpty(double[] a)
      Returns an empty double array if the specified array is null, otherwise returns the original array.
      Parameters:
      a - the double array to check
      Returns:
      an empty double array if the specified array is null, otherwise the original array
    • nullToEmpty

      public static BigInteger[] nullToEmpty(BigInteger[] a)
      Returns an empty BigInteger array if the specified array is null, otherwise returns the original array.
      Parameters:
      a - the BigInteger array to check
      Returns:
      an empty BigInteger array if the specified array is null, otherwise the original array
    • nullToEmpty

      public static BigDecimal[] nullToEmpty(BigDecimal[] a)
      Returns an empty BigDecimal array if the specified array is null, otherwise returns the original array.
      Parameters:
      a - the BigDecimal array to check
      Returns:
      an empty BigDecimal array if the specified array is null, otherwise the original array
    • nullToEmpty

      public static String[] nullToEmpty(String[] a)
      Returns an empty String array if the specified array is null, otherwise returns the original array.
      Parameters:
      a - the String array to check
      Returns:
      an empty String array if the specified array is null, otherwise the original array
      See Also:
    • nullToEmptyForEach

      @Beta public static String[] nullToEmptyForEach(String[] a)
      Converts the specified String array to an empty String[0] if it's null and each null element String to empty String "".
      Parameters:
      a - the String array to check
      Returns:
      an empty String array if the specified array is null, otherwise the original array with each null element replaced by an empty string
      See Also:
    • nullToEmpty

      public static Date[] nullToEmpty(Date[] a)
      Returns an empty Date array if the specified array is null, otherwise returns the original array.
      Parameters:
      a - the Date array to check
      Returns:
      an empty Date array if the specified array is null, otherwise the original array
    • nullToEmpty

      public static Date[] nullToEmpty(Date[] a)
      Returns an empty Date array if the specified array is null, otherwise returns the original array.
      Parameters:
      a - the Date array to check
      Returns:
      an empty Date array if the specified array is null, otherwise the original array
    • nullToEmpty

      public static Time[] nullToEmpty(Time[] a)
      Returns an empty Time array if the specified array is null, otherwise returns the original array.
      Parameters:
      a - the Time array to check
      Returns:
      an empty Time array if the specified array is null, otherwise the original array
    • nullToEmpty

      public static Timestamp[] nullToEmpty(Timestamp[] a)
      Returns an empty Timestamp array if the specified array is null, otherwise returns the original array.
      Parameters:
      a - the Timestamp array to check
      Returns:
      an empty Timestamp array if the specified array is null, otherwise the original array
    • nullToEmpty

      public static Calendar[] nullToEmpty(Calendar[] a)
      Returns an empty Calendar array if the specified array is null, otherwise returns the original array.
      Parameters:
      a - the Calendar array to check
      Returns:
      an empty Calendar array if the specified array is null, otherwise the original array
    • nullToEmpty

      public static Object[] nullToEmpty(Object[] a)
      Returns an empty Object array if the specified array is null, otherwise returns the original array.
      Parameters:
      a - the Object array to check
      Returns:
      an empty Object array if the specified array is null, otherwise the original array
    • nullToEmpty

      public static <T> T[] nullToEmpty(T[] a, Class<T[]> arrayType)
      Returns an empty array of the specified type if the given array is null, otherwise returns the original array.
      Type Parameters:
      T - the component type of the array
      Parameters:
      a - the array to check
      arrayType - the class of the array type
      Returns:
      an empty array of the specified type if the given array is null, otherwise the original array
    • nullToEmpty

      public static <T> ImmutableCollection<T> nullToEmpty(ImmutableCollection<T> c)
      Returns an immutable/unmodifiable empty Collection if the specified ImmutableCollection is null, otherwise itself is returned.
      Type Parameters:
      T - the type of elements in the collection
      Parameters:
      c - the ImmutableCollection to check
      Returns:
      an empty ImmutableCollection if the specified collection is null, otherwise the original collection
    • nullToEmpty

      public static <T> ImmutableList<T> nullToEmpty(ImmutableList<T> list)
      Returns an immutable/unmodifiable empty list if the specified ImmutableList is null, otherwise returns the original list.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      list - the ImmutableList to check
      Returns:
      an empty ImmutableList if the specified list is null, otherwise the original list
    • nullToEmpty

      public static <T> ImmutableSet<T> nullToEmpty(ImmutableSet<T> set)
      Returns an immutable/unmodifiable empty set if the specified ImmutableSet is null, otherwise returns the original set.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      set - the ImmutableSet to check
      Returns:
      an empty ImmutableSet if the specified set is null, otherwise the original set
    • nullToEmpty

      public static <T> ImmutableSortedSet<T> nullToEmpty(ImmutableSortedSet<T> set)
      Returns an immutable/unmodifiable empty sorted set if the specified ImmutableSortedSet is null, otherwise returns the original set.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      set - the ImmutableSortedSet to check
      Returns:
      an empty ImmutableSortedSet if the specified set is null, otherwise the original set
    • nullToEmpty

      public static <T> ImmutableNavigableSet<T> nullToEmpty(ImmutableNavigableSet<T> set)
      Returns an immutable/unmodifiable empty navigable set if the specified ImmutableNavigableSet is null, otherwise returns the original set.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      set - the ImmutableNavigableSet to check
      Returns:
      an empty ImmutableNavigableSet if the specified set is null, otherwise the original set
    • nullToEmpty

      public static <K, V> ImmutableMap<K,V> nullToEmpty(ImmutableMap<K,V> map)
      Returns an immutable/unmodifiable empty map if the specified ImmutableMap is null, otherwise returns the original map.
      Type Parameters:
      K - the type of keys in the map
      V - the type of values in the map
      Parameters:
      map - the ImmutableMap to check
      Returns:
      an empty ImmutableMap if the specified map is null, otherwise the original map
    • nullToEmpty

      public static <K, V> ImmutableSortedMap<K,V> nullToEmpty(ImmutableSortedMap<K,V> map)
      Returns an immutable/unmodifiable empty sorted map if the specified ImmutableSortedMap is null, otherwise returns the original map.
      Type Parameters:
      K - the type of keys in the map
      V - the type of values in the map
      Parameters:
      map - the ImmutableSortedMap to check
      Returns:
      an empty ImmutableSortedMap if the specified map is null, otherwise the original map
    • nullToEmpty

      public static <K, V> ImmutableNavigableMap<K,V> nullToEmpty(ImmutableNavigableMap<K,V> map)
      Returns an immutable/unmodifiable empty navigable map if the specified ImmutableNavigableMap is null, otherwise returns the original map.
      Type Parameters:
      K - the type of keys in the map
      V - the type of values in the map
      Parameters:
      map - the ImmutableNavigableMap to check
      Returns:
      an empty ImmutableNavigableMap if the specified map is null, otherwise the original map
    • nullToEmpty

      public static <K, V> ImmutableBiMap<K,V> nullToEmpty(ImmutableBiMap<K,V> map)
      Returns an immutable/unmodifiable empty bi-map if the specified ImmutableBiMap is null, otherwise returns the original bi-map.
      Type Parameters:
      K - the type of keys in the bi-map
      V - the type of values in the bi-map
      Parameters:
      map - the ImmutableBiMap to check
      Returns:
      an empty ImmutableBiMap if the specified bi-map is null, otherwise the original bi-map
    • isEmpty

      public static boolean isEmpty(CharSequence cs)
      Checks if the specified CharSequence is null or empty.
      Parameters:
      cs - the CharSequence to check
      Returns:
      true if the CharSequence is null or empty, otherwise false
    • isEmpty

      public static boolean isEmpty(boolean[] a)
      Checks if the specified boolean array is null or empty.
      Parameters:
      a - the boolean array to check
      Returns:
      true if the boolean array is null or empty, otherwise false
    • isEmpty

      public static boolean isEmpty(char[] a)
      Checks if the specified char array is null or empty.
      Parameters:
      a - the char array to check
      Returns:
      true if the char array is null or empty, otherwise false
    • isEmpty

      public static boolean isEmpty(byte[] a)
      Checks if the specified byte array is null or empty.
      Parameters:
      a - the byte array to check
      Returns:
      true if the byte array is null or empty, otherwise false
    • isEmpty

      public static boolean isEmpty(short[] a)
      Checks if the specified short array is null or empty.
      Parameters:
      a - the short array to check
      Returns:
      true if the short array is null or empty, otherwise false
    • isEmpty

      public static boolean isEmpty(int[] a)
      Checks if the specified int array is null or empty.
      Parameters:
      a - the int array to check
      Returns:
      true if the int array is null or empty, otherwise false
    • isEmpty

      public static boolean isEmpty(long[] a)
      Checks if the specified long array is null or empty.
      Parameters:
      a - the long array to check
      Returns:
      true if the long array is null or empty, otherwise false
    • isEmpty

      public static boolean isEmpty(float[] a)
      Checks if the specified float array is null or empty.
      Parameters:
      a - the float array to check
      Returns:
      true if the float array is null or empty, otherwise false
    • isEmpty

      public static boolean isEmpty(double[] a)
      Checks if the specified double array is null or empty.
      Parameters:
      a - the double array to check
      Returns:
      true if the double array is null or empty, otherwise false
    • isEmpty

      public static boolean isEmpty(Object[] a)
      Checks if the specified object array is null or empty.
      Parameters:
      a - the object array to check
      Returns:
      true if the object array is null or empty, otherwise false
    • isEmpty

      public static boolean isEmpty(Collection<?> c)
      Checks if the specified Collection is null or empty.
      Parameters:
      c - the Collection to check
      Returns:
      true if the Collection is null or empty, otherwise false
    • isEmpty

      @Beta public static boolean isEmpty(Iterable<?> c)
      Checks if the specified iterable is null or empty.
      Parameters:
      c - the Iterable to check
      Returns:
      true if the Iterable is null or empty, otherwise false
    • isEmpty

      @Beta public static boolean isEmpty(Iterator<?> iter)
      Checks if the specified iterator is null or empty.
      Parameters:
      iter - the Iterator to check
      Returns:
      true if the Iterator is null or empty, otherwise false
    • isEmpty

      public static boolean isEmpty(Map<?,?> m)
      Checks if the specified Map is null or empty.
      Parameters:
      m - the Map to check
      Returns:
      true if the Map is null or empty, otherwise false
    • isEmpty

      public static boolean isEmpty(PrimitiveList list)
      Checks if the specified PrimitiveList is null or empty.
      Parameters:
      list - the PrimitiveList to check
      Returns:
      true if the PrimitiveList is null or empty, otherwise false
    • isEmpty

      public static boolean isEmpty(Multiset<?> s)
      Checks if the specified Multiset is null or empty.
      Parameters:
      s - the Multiset to check
      Returns:
      true if the Multiset is null or empty, otherwise false
    • isEmpty

      public static boolean isEmpty(Multimap<?,?,?> m)
      Checks if the specified Multimap is null or empty.
      Parameters:
      m - the Multimap to check
      Returns:
      true if the Multimap is null or empty, otherwise false
    • isEmpty

      public static boolean isEmpty(DataSet ds)
      Checks if the specified DataSet is null or empty.
      Parameters:
      ds - the DataSet to check
      Returns:
      true if the DataSet is null or empty, otherwise false
    • isBlank

      public static boolean isBlank(CharSequence cs)
      Checks if the specified CharSequence is null, empty, or contains only whitespace characters.
      Parameters:
      cs - the CharSequence to check
      Returns:
      true if the CharSequence is null, empty, or contains only whitespace characters, otherwise false
      See Also:
    • notEmpty

      public static boolean notEmpty(CharSequence cs)
      Checks if the specified CharSequence is not null and not empty.
      Parameters:
      cs - the CharSequence to check
      Returns:
      true if the CharSequence is not null and not empty, otherwise false
      See Also:
    • notEmpty

      public static boolean notEmpty(boolean[] a)
      Checks if the specified boolean array is not null and not empty.
      Parameters:
      a - the boolean array to check
      Returns:
      true if the boolean array is not null and not empty, otherwise false
    • notEmpty

      public static boolean notEmpty(char[] a)
      Checks if the specified char array is not null and not empty.
      Parameters:
      a - the char array to check
      Returns:
      true if the char array is not null and not empty, otherwise false
    • notEmpty

      public static boolean notEmpty(byte[] a)
      Checks if the specified byte array is not null and not empty.
      Parameters:
      a - the byte array to check
      Returns:
      true if the byte array is not null and not empty, otherwise false
    • notEmpty

      public static boolean notEmpty(short[] a)
      Checks if the specified short array is not null and not empty.
      Parameters:
      a - the short array to check
      Returns:
      true if the short array is not null and not empty, otherwise false
    • notEmpty

      public static boolean notEmpty(int[] a)
      Checks if the specified int array is not null and not empty.
      Parameters:
      a - the int array to check
      Returns:
      true if the int array is not null and not empty, otherwise false
    • notEmpty

      public static boolean notEmpty(long[] a)
      Checks if the specified long array is not null and not empty.
      Parameters:
      a - the long array to check
      Returns:
      true if the long array is not null and not empty, otherwise false
    • notEmpty

      public static boolean notEmpty(float[] a)
      Checks if the specified float array is not null and not empty.
      Parameters:
      a - the float array to check
      Returns:
      true if the float array is not null and not empty, otherwise false
    • notEmpty

      public static boolean notEmpty(double[] a)
      Checks if the specified double array is not null and not empty.
      Parameters:
      a - the double array to check
      Returns:
      true if the double array is not null and not empty, otherwise false
    • notEmpty

      public static boolean notEmpty(Object[] a)
      Checks if the specified object array is not null and not empty.
      Parameters:
      a - the object array to check
      Returns:
      true if the object array is not null and not empty, otherwise false
    • notEmpty

      public static boolean notEmpty(Collection<?> c)
      Checks if the specified Collection is not null and not empty.
      Parameters:
      c - the Collection to check
      Returns:
      true if the Collection is not null and not empty, otherwise false
    • notEmpty

      @Beta public static boolean notEmpty(Iterable<?> iter)
      Checks if the specified iterable is not null and not empty.
      Parameters:
      iter - the Iterable to check
      Returns:
      true if the Iterable is not null and not empty, otherwise false
    • notEmpty

      @Beta public static boolean notEmpty(Iterator<?> iter)
      Checks if the specified iterator is not null and not empty.
      Parameters:
      iter - the Iterator to check
      Returns:
      true if the Iterator is not null and not empty, otherwise false
    • notEmpty

      public static boolean notEmpty(Map<?,?> m)
      Checks if the specified Map is not null and not empty.
      Parameters:
      m - the Map to check
      Returns:
      true if the Map is not null and not empty, otherwise false
    • notEmpty

      public static boolean notEmpty(PrimitiveList list)
      Checks if the specified PrimitiveList is not null and not empty.
      Parameters:
      list - the PrimitiveList to check
      Returns:
      true if the PrimitiveList is not null and not empty, otherwise false
    • notEmpty

      public static boolean notEmpty(Multiset<?> s)
      Checks if the specified Multiset is not null and not empty.
      Parameters:
      s - the Multiset to check
      Returns:
      true if the Multiset is not null and not empty, otherwise false
    • notEmpty

      public static boolean notEmpty(Multimap<?,?,?> m)
      Checks if the specified Multimap is not null and not empty.
      Parameters:
      m - the Multimap to check
      Returns:
      true if the Multimap is not null and not empty, otherwise false
    • notEmpty

      public static boolean notEmpty(DataSet rs)
      Checks if the specified DataSet is not null and not empty.
      Parameters:
      ds - the DataSet to check
      Returns:
      true if the DataSet is not null and not empty, otherwise false
    • notBlank

      public static boolean notBlank(CharSequence cs)
      Checks if the specified CharSequence is not null and not empty and not contains only whitespace characters.
      Parameters:
      cs - the CharSequence to check
      Returns:
      true if the CharSequence is not null and not empty and not contains only whitespace characters, otherwise false
      See Also:
    • anyNull

      public static boolean anyNull(Object a, Object b)
      Checks if any of the specified objects is null.
      Parameters:
      a - the first object to check
      b - the second object to check
      Returns:
      true if any of the objects is null, otherwise false
    • anyNull

      public static boolean anyNull(Object a, Object b, Object c)
      Checks if any of the specified objects is null.
      Parameters:
      a - the first object to check
      b - the second object to check
      c - the third object to check
      Returns:
      true if any of the objects is null, otherwise false
    • anyNull

      @SafeVarargs public static boolean anyNull(Object... a)
      Checks if any element in the specified array is null.
      Parameters:
      a - the array of objects to check
      Returns:
      true if any element in the specified array is null, otherwise false
    • anyNull

      public static boolean anyNull(Collection<?> c)
      Checks if any element in the specified collection is null.
      Parameters:
      c - the collection of objects to check
      Returns:
      true if any element in the specified collection is null, otherwise false
    • anyEmpty

      public static boolean anyEmpty(CharSequence a, CharSequence b)
      Checks if any of the specified CharSequences is empty ("") or null.
      Parameters:
      a - the first CharSequence to check
      b - the second CharSequence to check
      Returns:
      true if any of the CharSequences is empty, otherwise false
      See Also:
    • anyEmpty

      public static boolean anyEmpty(CharSequence a, CharSequence b, CharSequence c)
      Checks if any of the specified CharSequences is empty ("") or null.
      Parameters:
      a - the first CharSequence to check
      b - the second CharSequence to check
      c - the third CharSequence to check
      Returns:
      true if any of the CharSequences is empty, otherwise false
      See Also:
    • anyEmpty

      public static boolean anyEmpty(CharSequence... css)

      Checks if any of the CharSequences is empty ("") or null.

       Strings.anyEmpty((String) null)    = true
       Strings.anyEmpty((String[]) null)  = false
       Strings.anyEmpty(null, "foo")      = true
       Strings.anyEmpty("", "bar")        = true
       Strings.anyEmpty("bob", "")        = true
       Strings.anyEmpty("  bob  ", null)  = true
       Strings.anyEmpty(" ", "bar")       = false
       Strings.anyEmpty("foo", "bar")     = false
       Strings.anyEmpty(new String[]{})   = false
       Strings.anyEmpty(new String[]{""}) = true
       
      Parameters:
      css - the CharSequences to check, may be null or empty
      Returns:
      true if any of the CharSequences are empty or null
      See Also:
    • anyEmpty

      public static boolean anyEmpty(Collection<? extends CharSequence> css)
      Checks if any of the specified CharSequence objects in the collection is empty.
      Parameters:
      css - the collection of CharSequence objects to check
      Returns:
      true if any of the CharSequence objects is empty, otherwise false
      See Also:
    • anyEmpty

      public static boolean anyEmpty(Object[] a, Object[] b)
      Checks if any of the specified arrays is empty.
      Parameters:
      a - the first array to check
      b - the second array to check
      Returns:
      true if any of the arrays is empty, otherwise false
    • anyEmpty

      public static boolean anyEmpty(Object[] a, Object[] b, Object[] c)
      Checks if any of the specified arrays is empty.
      Parameters:
      a - the first array to check
      b - the second array to check
      c - the third array to check
      Returns:
      true if any of the arrays is empty, otherwise false
    • anyEmpty

      public static boolean anyEmpty(Collection<?> a, Collection<?> b)
      Checks if any of the specified collections is empty.
      Parameters:
      a - the first collection to check
      b - the second collection to check
      Returns:
      true if any of the collections is empty, otherwise false
    • anyEmpty

      public static boolean anyEmpty(Collection<?> a, Collection<?> b, Collection<?> c)
      Checks if any of the specified collections is empty.
      Parameters:
      a - the first collection to check
      b - the second collection to check
      c - the third collection to check
      Returns:
      true if any of the collections is empty, otherwise false
    • anyBlank

      public static boolean anyBlank(CharSequence a, CharSequence b)
      Checks if any of the specified CharSequences is blank.
      Parameters:
      a - the first CharSequence to check
      b - the second CharSequence to check
      Returns:
      true if any of the CharSequences is blank, otherwise false
      See Also:
    • anyBlank

      public static boolean anyBlank(CharSequence a, CharSequence b, CharSequence c)
      Checks if any of the specified CharSequences is blank.
      Parameters:
      a - the first CharSequence to check
      b - the second CharSequence to check
      c - the third CharSequence to check
      Returns:
      true if any of the CharSequences is blank, otherwise false
      See Also:
    • anyBlank

      public static boolean anyBlank(CharSequence... css)

      Checks if any of the CharSequences are empty ("") or null or whitespace only.

      Whitespace is defined by Character.isWhitespace(char).

       Strings.anyBlank((String) null)    = true
       Strings.anyBlank((String[]) null)  = false
       Strings.anyBlank(null, "foo")      = true
       Strings.anyBlank(null, null)       = true
       Strings.anyBlank("", "bar")        = true
       Strings.anyBlank("bob", "")        = true
       Strings.anyBlank("  bob  ", null)  = true
       Strings.anyBlank(" ", "bar")       = true
       Strings.anyBlank(new String[] {})  = false
       Strings.anyBlank(new String[]{""}) = true
       Strings.anyBlank("foo", "bar")     = false
       
      Parameters:
      css - the CharSequences to check, may be null or empty
      Returns:
      true if any of the CharSequences are empty or null or whitespace only
      See Also:
    • anyBlank

      public static boolean anyBlank(Collection<? extends CharSequence> css)
      Checks if any of the specified CharSequences in the collection is blank.
      Parameters:
      css - the collection of CharSequences to check
      Returns:
      true if any of the CharSequences is blank, otherwise false
      See Also:
      • invalid reference
        Strings#isAnyBlank(Collection)
    • allNull

      public static boolean allNull(Object a, Object b)
      Checks if both specified objects are null.
      Parameters:
      a - the first object to check
      b - the second object to check
      Returns:
      true if both objects are null, otherwise false
    • allNull

      public static boolean allNull(Object a, Object b, Object c)
      Checks if all specified objects are null.
      Parameters:
      a - the first object to check
      b - the second object to check
      c - the third object to check
      Returns:
      true if all objects are null, otherwise false
    • allNull

      @SafeVarargs public static boolean allNull(Object... a)
      Checks if all specified objects are null.
      Parameters:
      a - the objects to check
      Returns:
      true if all objects are null, otherwise false
    • allNull

      public static boolean allNull(Collection<?> c)
      Checks if all elements in the specified collection are null.
      Parameters:
      c - the collection of objects to check
      Returns:
      true if all elements in the specified collection are null, otherwise false
    • allEmpty

      public static boolean allEmpty(CharSequence a, CharSequence b)
      Checks if both specified CharSequences are empty ("") or null.
      Parameters:
      a - the first CharSequence to check
      b - the second CharSequence to check
      Returns:
      true if both CharSequences are empty, otherwise false
      See Also:
    • allEmpty

      public static boolean allEmpty(CharSequence a, CharSequence b, CharSequence c)
      Checks if all of the specified CharSequences are empty ("") or null.
      Parameters:
      a - the first CharSequence to check
      b - the second CharSequence to check
      c - the third CharSequence to check
      Returns:
      true if all of the CharSequences are empty, otherwise false
      See Also:
    • allEmpty

      public static boolean allEmpty(CharSequence... css)

      Checks if all of the CharSequences are empty ("") or null.

       Strings.allEmpty(null)             = true
       Strings.allEmpty(null, "")         = true
       Strings.allEmpty(new String[] {})  = true
       Strings.allEmpty(null, "foo")      = false
       Strings.allEmpty("", "bar")        = false
       Strings.allEmpty("bob", "")        = false
       Strings.allEmpty("  bob  ", null)  = false
       Strings.allEmpty(" ", "bar")       = false
       Strings.allEmpty("foo", "bar")     = false
       
      Parameters:
      css - the CharSequences to check, may be null or empty
      Returns:
      true if all of the CharSequences are empty or null
      See Also:
    • allEmpty

      public static boolean allEmpty(Collection<? extends CharSequence> css)
      Checks if all specified CharSequences in the collection are empty or null.
      Parameters:
      css - the collection of CharSequences to check, may be null or empty
      Returns:
      true if all CharSequences in the collection are empty or null, otherwise false
    • allEmpty

      public static boolean allEmpty(Object[] a, Object[] b)
      Checks if all specified object arrays are empty.
      Parameters:
      a - the first object array to check, may be null
      b - the second object array to check, may be null
      Returns:
      true if both object arrays are empty or null, otherwise false
    • allEmpty

      public static boolean allEmpty(Object[] a, Object[] b, Object[] c)
      Checks if all specified object arrays are empty.
      Parameters:
      a - the first object array to check, may be null
      b - the second object array to check, may be null
      c - the third object array to check, may be null
      Returns:
      true if all object arrays are empty or null, otherwise false
    • allEmpty

      public static boolean allEmpty(Collection<?> a, Collection<?> b)
      Checks if all specified collections are empty.
      Parameters:
      a - the first collection to check, may be null
      b - the second collection to check, may be null
      Returns:
      true if both collections are empty or null, otherwise false
    • allEmpty

      public static boolean allEmpty(Collection<?> a, Collection<?> b, Collection<?> c)
      Checks if all specified collections are empty.
      Parameters:
      a - the first collection to check, may be null
      b - the second collection to check, may be null
      c - the third collection to check, may be null
      Returns:
      true if all collections are empty or null, otherwise false
    • allBlank

      public static boolean allBlank(CharSequence a, CharSequence b)
      Checks if both specified CharSequences are blank.
      Parameters:
      a - the first CharSequence to check
      b - the second CharSequence to check
      Returns:
      true if both CharSequences are blank, otherwise false
      See Also:
    • allBlank

      public static boolean allBlank(CharSequence a, CharSequence b, CharSequence c)
      Checks if all of the specified CharSequences are blank.
      Parameters:
      a - the first CharSequence to check
      b - the second CharSequence to check
      c - the third CharSequence to check
      Returns:
      true if all of the CharSequences are blank, otherwise false
      See Also:
    • allBlank

      public static boolean allBlank(CharSequence... css)

      Checks if all of the CharSequences are empty (""), null or whitespace only.

      Whitespace is defined by Character.isWhitespace(char).

       Strings.allBlank(null)             = true
       Strings.allBlank(null, "foo")      = false
       Strings.allBlank(null, null)       = true
       Strings.allBlank("", "bar")        = false
       Strings.allBlank("bob", "")        = false
       Strings.allBlank("  bob  ", null)  = false
       Strings.allBlank(" ", "bar")       = false
       Strings.allBlank("foo", "bar")     = false
       Strings.allBlank(new String[] {})  = true
       
      Parameters:
      css - the CharSequences to check, may be null or empty
      Returns:
      true if all of the CharSequences are empty or null or whitespace only
      See Also:
    • allBlank

      public static boolean allBlank(Collection<? extends CharSequence> css)
      Checks if all specified CharSequences in the collection are blank.
      Parameters:
      css - the collection of CharSequences to check
      Returns:
      true if all CharSequences in the collection are blank, otherwise false
      See Also:
      • invalid reference
        Strings#isAllBlank(Collection)
    • checkFromToIndex

      public static void checkFromToIndex(int fromIndex, int toIndex, int length) throws IndexOutOfBoundsException
      Checks if the specified range starting from fromIndex and ending with toIndex are within the bounds of the specified length.
      Parameters:
      fromIndex - the starting index to check, inclusive
      toIndex - the ending index to check, exclusive
      length - the length of the array or collection
      Throws:
      IndexOutOfBoundsException - if the range is out of bounds
    • checkFromIndexSize

      public static void checkFromIndexSize(int fromIndex, int size, int length) throws IndexOutOfBoundsException
      Checks if the specified range starting from fromIndex with the specified size is within the bounds of the specified length.
      Parameters:
      fromIndex - the starting index to check, inclusive
      size - the size of the range to check
      length - the length of the array or collection
      Throws:
      IndexOutOfBoundsException - if the range is out of bounds
    • checkIndex

      @Deprecated public static int checkIndex(int index, int size)
      Deprecated.
      Ensures that index specifies a valid element in an array, list or string of size size. An element index may range from zero, inclusive, to size, exclusive.
      Parameters:
      index - a user-supplied index identifying an element of an array, list or string
      size - the size of that array, list or string
      Returns:
      the value of index
      Throws:
      IndexOutOfBoundsException - if index is negative or is not less than size
      IllegalArgumentException - if size is negative
    • checkElementIndex

      public static int checkElementIndex(int index, int size)

      Copied from Google Guava under Apache License v2.0 and may be modified.

      Ensures that index specifies a valid element in an array, list or string of size size. An element index may range from zero, inclusive, to size, exclusive.
      Parameters:
      index - a user-supplied index identifying an element of an array, list or string
      size - the size of that array, list or string
      Returns:
      the value of index
      Throws:
      IndexOutOfBoundsException - if index is negative or is not less than size
      IllegalArgumentException - if size is negative
    • checkElementIndex

      public static int checkElementIndex(int index, int size, String desc)

      Copied from Google Guava under Apache License v2.0 and may be modified.

      Ensures that index specifies a valid element in an array, list or string of size size. An element index may range from zero, inclusive, to size, exclusive.
      Parameters:
      index - a user-supplied index identifying an element of an array, list or string
      size - the size of that array, list or string
      desc - the text to use to describe this index in an error message
      Returns:
      the value of index
      Throws:
      IndexOutOfBoundsException - if index is negative or is not less than size
      IllegalArgumentException - if size is negative
    • checkPositionIndex

      public static int checkPositionIndex(int index, int size) throws IllegalArgumentException, IndexOutOfBoundsException

      Copied from Google Guava under Apache License v2.0 and may be modified.

      Ensures that index specifies a valid position in an array, list or string of size size. A position index may range from zero to size, inclusive.
      Parameters:
      index - a user-supplied index identifying a position in an array, list or string
      size - the size of that array, list or string
      Returns:
      the value of index
      Throws:
      IllegalArgumentException - if size is negative
      IndexOutOfBoundsException - if index is negative or is greater than size
    • checkPositionIndex

      public static int checkPositionIndex(int index, int size, String desc) throws IllegalArgumentException, IndexOutOfBoundsException

      Copied from Google Guava under Apache License v2.0 and may be modified.

      Ensures that index specifies a valid position in an array, list or string of size size. A position index may range from zero to size, inclusive.
      Parameters:
      index - a user-supplied index identifying a position in an array, list or string
      size - the size of that array, list or string
      desc - the text to use to describe this index in an error message
      Returns:
      the value of index
      Throws:
      IllegalArgumentException - if size is negative
      IndexOutOfBoundsException - if index is negative or is greater than size
    • checkArgNotNull

      public static <T> T checkArgNotNull(T obj) throws IllegalArgumentException
      Checks if the specified argument is not null, and throws IllegalArgumentException if it is.
      Type Parameters:
      T - the type of the argument
      Parameters:
      obj - the argument to check
      Returns:
      the non-null argument
      Throws:
      IllegalArgumentException - if the argument is null
    • checkArgNotNull

      public static <T> T checkArgNotNull(T obj, String errorMessage) throws IllegalArgumentException
      Checks if the specified argument is not null, and throws IllegalArgumentException if it is.
      Type Parameters:
      T - the type of the argument
      Parameters:
      obj - the argument to check
      errorMessage - the error message to use in the exception
      Returns:
      the non-null argument
      Throws:
      IllegalArgumentException - if the argument is null
    • checkArgNotEmpty

      public static <T extends CharSequence> T checkArgNotEmpty(T arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified charSequence argument is null or empty, and throws IllegalArgumentException if it is.
      Type Parameters:
      T - the type of the argument, which extends CharSequence
      Parameters:
      arg - the argument to check
      argNameOrErrorMsg - the name of the argument or an error message to be used in the exception
      Returns:
      the non-null and non-empty argument
      Throws:
      IllegalArgumentException - if the argument is null or empty
    • checkArgNotEmpty

      public static boolean[] checkArgNotEmpty(boolean[] arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified boolean array argument is not null or empty, and throws IllegalArgumentException if it is.
      Parameters:
      arg - the boolean array argument to check
      argNameOrErrorMsg - the name of the argument or an error message to be used in the exception
      Returns:
      the non-null and non-empty boolean array argument
      Throws:
      IllegalArgumentException - if the argument is null or empty
    • checkArgNotEmpty

      public static char[] checkArgNotEmpty(char[] arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified char array argument is not null or empty, and throws IllegalArgumentException if it is.
      Parameters:
      arg - the char array argument to check
      argNameOrErrorMsg - the name of the argument or an error message to be used in the exception
      Returns:
      the non-null and non-empty char array argument
      Throws:
      IllegalArgumentException - if the argument is null or empty
    • checkArgNotEmpty

      public static byte[] checkArgNotEmpty(byte[] arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified byte array argument is not null or empty, and throws IllegalArgumentException if it is.
      Parameters:
      arg - the byte array argument to check
      argNameOrErrorMsg - the name of the argument or an error message to be used in the exception
      Returns:
      the non-null and non-empty byte array argument
      Throws:
      IllegalArgumentException - if the argument is null or empty
    • checkArgNotEmpty

      public static short[] checkArgNotEmpty(short[] arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified short array argument is not null or empty, and throws IllegalArgumentException if it is.
      Parameters:
      arg - the short array argument to check
      argNameOrErrorMsg - the name of the argument or an error message to be used in the exception
      Returns:
      the non-null and non-empty short array argument
      Throws:
      IllegalArgumentException - if the argument is null or empty
    • checkArgNotEmpty

      public static int[] checkArgNotEmpty(int[] arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified int array argument is not null or empty, and throws IllegalArgumentException if it is.
      Parameters:
      arg - the int array argument to check
      argNameOrErrorMsg - the name of the argument or an error message to be used in the exception
      Returns:
      the non-null and non-empty int array argument
      Throws:
      IllegalArgumentException - if the argument is null or empty
    • checkArgNotEmpty

      public static long[] checkArgNotEmpty(long[] arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified long array argument is not null or empty, and throws IllegalArgumentException if it is.
      Parameters:
      arg - the long array argument to check
      argNameOrErrorMsg - the name of the argument or an error message to be used in the exception
      Returns:
      the non-null and non-empty long array argument
      Throws:
      IllegalArgumentException - if the argument is null or empty
    • checkArgNotEmpty

      public static float[] checkArgNotEmpty(float[] arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified float array argument is not null or empty, and throws IllegalArgumentException if it is.
      Parameters:
      arg - the float array argument to check
      argNameOrErrorMsg - the name of the argument or an error message to be used in the exception
      Returns:
      the non-null and non-empty float array argument
      Throws:
      IllegalArgumentException - if the argument is null or empty
    • checkArgNotEmpty

      public static double[] checkArgNotEmpty(double[] arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified double array argument is not null or empty, and throws IllegalArgumentException if it is.
      Parameters:
      arg - the double array argument to check
      argNameOrErrorMsg - the name of the argument or an error message to be used in the exception
      Returns:
      the non-null and non-empty double array argument
      Throws:
      IllegalArgumentException - if the argument is null or empty
    • checkArgNotEmpty

      public static <T> T[] checkArgNotEmpty(T[] arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified Object array argument is not null or empty, and throws IllegalArgumentException if it is.
      Type Parameters:
      T - the type of the argument
      Parameters:
      arg - the Object array argument to check
      argNameOrErrorMsg - the name of the argument or an error message to be used in the exception
      Returns:
      the non-null and non-empty Object array argument
      Throws:
      IllegalArgumentException - if the argument is null or empty
    • checkArgNotEmpty

      public static <T extends Collection<?>> T checkArgNotEmpty(T arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified collection argument is not null or empty, and throws IllegalArgumentException if it is.
      Parameters:
      arg - the boolean collection argument to check
      argNameOrErrorMsg - the name of the argument or an error message to be used in the exception
      Returns:
      the non-null and non-empty boolean collection argument
      Throws:
      IllegalArgumentException - if the argument is null or empty
    • checkArgNotEmpty

      @Beta public static <T extends Iterable<?>> T checkArgNotEmpty(T arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified Iterable argument is not null or empty, and throws IllegalArgumentException if it is.
      Parameters:
      arg - the Iterable argument to check
      argNameOrErrorMsg - the name of the argument or an error message to be used in the exception
      Returns:
      the non-null and non-empty Iterable argument
      Throws:
      IllegalArgumentException - if the argument is null or empty
    • checkArgNotEmpty

      @Beta public static <T extends Iterator<?>> T checkArgNotEmpty(T arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified Iterator argument is not null or empty, and throws IllegalArgumentException if it is.
      Parameters:
      arg - the Iterator argument to check
      argNameOrErrorMsg - the name of the argument or an error message to be used in the exception
      Returns:
      the non-null and non-empty Iterator argument
      Throws:
      IllegalArgumentException - if the argument is null or empty
    • checkArgNotEmpty

      public static <T extends Map<?, ?>> T checkArgNotEmpty(T arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified Map argument is not null or empty, and throws IllegalArgumentException if it is.
      Type Parameters:
      T - the type of the argument
      Parameters:
      arg - the Map argument to check
      argNameOrErrorMsg - the name of the argument or an error message to be used in the exception
      Returns:
      the non-null and non-empty Map argument
      Throws:
      IllegalArgumentException - if the argument is null or empty
    • checkArgNotEmpty

      public static <T extends PrimitiveList<?, ?, ?>> T checkArgNotEmpty(T arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified PrimitiveList argument is not null or empty, and throws IllegalArgumentException if it is.
      Type Parameters:
      T - the type of the argument
      Parameters:
      arg - the PrimitiveList argument to check
      argNameOrErrorMsg - the name of the argument or an error message to be used in the exception
      Returns:
      the non-null and non-empty PrimitiveList argument
      Throws:
      IllegalArgumentException - if the argument is null or empty
    • checkArgNotEmpty

      public static <T> Multiset<T> checkArgNotEmpty(Multiset<T> arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified Multiset argument is not null or empty, and throws IllegalArgumentException if it is.
      Type Parameters:
      T - the type of the argument
      Parameters:
      arg - the Multiset argument to check
      argNameOrErrorMsg - the name of the argument or an error message to be used in the exception
      Returns:
      the non-null and non-empty Multiset argument
      Throws:
      IllegalArgumentException - if the argument is null or empty
    • checkArgNotEmpty

      public static <T extends Multimap<?, ?, ?>> T checkArgNotEmpty(T arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified Multimap argument is not null or empty, and throws IllegalArgumentException if it is.
      Type Parameters:
      T - the type of the argument
      Parameters:
      arg - the Multimap argument to check
      argNameOrErrorMsg - the name of the argument or an error message to be used in the exception
      Returns:
      the non-null and non-empty Multimap argument
      Throws:
      IllegalArgumentException - if the argument is null or empty
    • checkArgNotEmpty

      public static <T extends DataSet> T checkArgNotEmpty(T arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified DataSet argument is not null or empty, and throws IllegalArgumentException if it is.
      Type Parameters:
      T - the type of the argument
      Parameters:
      arg - the DataSet argument to check
      argNameOrErrorMsg - the name of the argument or an error message to be used in the exception
      Returns:
      the non-null and non-empty DataSet argument
      Throws:
      IllegalArgumentException - if the argument is null or empty
    • checkArgNotBlank

      public static <T extends CharSequence> T checkArgNotBlank(T arg, String msg) throws IllegalArgumentException
      Checks if the specified charSequence argument is not null or empty or blank, and throws IllegalArgumentException if it is.
      Type Parameters:
      T - the type of the argument, which extends CharSequence
      Parameters:
      arg - the argument to check
      argNameOrErrorMsg - the name of the argument or an error message to be used in the exception
      Returns:
      the non-null and non-empty and non-blank argument
      Throws:
      IllegalArgumentException - if the argument is null or empty or blank
    • checkArgNotNegative

      public static byte checkArgNotNegative(byte arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified byte argument is not negative, and throws IllegalArgumentException if it is.
      Parameters:
      arg - the byte argument to check
      argNameOrErrorMsg - the name of the argument or an error message to be used in the exception
      Returns:
      the non-negative byte argument
      Throws:
      IllegalArgumentException - if the specified arg is negative
    • checkArgNotNegative

      public static short checkArgNotNegative(short arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified short argument is not negative, and throws IllegalArgumentException if it is.
      Parameters:
      arg - the short argument to check
      argNameOrErrorMsg - the name of the argument or an error message to be used in the exception
      Returns:
      the non-negative short argument
      Throws:
      IllegalArgumentException - if the specified arg is negative
    • checkArgNotNegative

      public static int checkArgNotNegative(int arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified int argument is not negative, and throws IllegalArgumentException if it is.
      Parameters:
      arg - the int argument to check
      argNameOrErrorMsg - the name of the argument or an error message to be used in the exception
      Returns:
      the non-negative int argument
      Throws:
      IllegalArgumentException - if the specified arg is negative
    • checkArgNotNegative

      public static long checkArgNotNegative(long arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified long argument is not negative, and throws IllegalArgumentException if it is.
      Parameters:
      arg - the long argument to check
      argNameOrErrorMsg - the name of the argument or an error message to be used in the exception
      Returns:
      the non-negative long argument
      Throws:
      IllegalArgumentException - if the specified arg is negative
    • checkArgNotNegative

      public static float checkArgNotNegative(float arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified float argument is not negative, and throws IllegalArgumentException if it is.
      Parameters:
      arg - the float argument to check
      argNameOrErrorMsg - the name of the argument or an error message to be used in the exception
      Returns:
      the non-negative float argument
      Throws:
      IllegalArgumentException - if the specified arg is negative
    • checkArgNotNegative

      public static double checkArgNotNegative(double arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified double argument is not negative, and throws IllegalArgumentException if it is.
      Parameters:
      arg - the double argument to check
      argNameOrErrorMsg - the name of the argument or an error message to be used in the exception
      Returns:
      the non-negative double argument
      Throws:
      IllegalArgumentException - if the specified arg is negative
    • checkArgPositive

      public static byte checkArgPositive(byte arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified byte argument is positive, and throws IllegalArgumentException if it is not.
      Parameters:
      arg - the byte argument to check
      argNameOrErrorMsg - the name of the argument or an error message to be used in the exception
      Returns:
      the positive byte argument
      Throws:
      IllegalArgumentException - if the specified arg is not positive
    • checkArgPositive

      public static short checkArgPositive(short arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified short argument is positive, and throws IllegalArgumentException if it is not.
      Parameters:
      arg - the short argument to check
      argNameOrErrorMsg - the name of the argument or an error message to be used in the exception
      Returns:
      the positive short argument
      Throws:
      IllegalArgumentException - if the specified arg is not positive
    • checkArgPositive

      public static int checkArgPositive(int arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified int argument is positive, and throws IllegalArgumentException if it is not.
      Parameters:
      arg - the int argument to check
      argNameOrErrorMsg - the name of the argument or an error message to be used in the exception
      Returns:
      the positive int argument
      Throws:
      IllegalArgumentException - if the specified arg is not positive
    • checkArgPositive

      public static long checkArgPositive(long arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified long argument is positive, and throws IllegalArgumentException if it is not.
      Parameters:
      arg - the long argument to check
      argNameOrErrorMsg - the name of the argument or an error message to be used in the exception
      Returns:
      the positive long argument
      Throws:
      IllegalArgumentException - if the specified arg is not positive
    • checkArgPositive

      public static float checkArgPositive(float arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified float argument is positive, and throws IllegalArgumentException if it is not.
      Parameters:
      arg - the float argument to check
      argNameOrErrorMsg - the name of the argument or an error message to be used in the exception
      Returns:
      the positive float argument
      Throws:
      IllegalArgumentException - if the specified arg is not positive
    • checkArgPositive

      public static double checkArgPositive(double arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified double argument is positive, and throws IllegalArgumentException if it is not.
      Parameters:
      arg - the double argument to check
      argNameOrErrorMsg - the name of the argument or an error message to be used in the exception
      Returns:
      the positive double argument
      Throws:
      IllegalArgumentException - if the specified arg is not positive
    • checkElementNotNull

      public static void checkElementNotNull(Object[] a) throws IllegalArgumentException
      Checks if the specified array not contains any null element, and throws IllegalArgumentException if it does.
      Parameters:
      a - the array to check
      Throws:
      IllegalArgumentException - if a null element is found in the array
    • checkElementNotNull

      public static void checkElementNotNull(Object[] a, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified array not contains any null element, and throws IllegalArgumentException if it does.
      Parameters:
      a - the array to check
      argNameOrErrorMsg - the name of the argument or an error message to be used in the exception
      Throws:
      IllegalArgumentException - if a null element is found in the array
    • checkElementNotNull

      public static void checkElementNotNull(Collection<?> c) throws IllegalArgumentException
      Check if the specified Collection not contains any null element, and throws IllegalArgumentException if it does.
      Parameters:
      c - the collection to check
      Throws:
      IllegalArgumentException - if null element found in c
    • checkElementNotNull

      public static void checkElementNotNull(Collection<?> c, String argNameOrErrorMsg) throws IllegalArgumentException
      Check if the specified Collection not contains any null element, and throws IllegalArgumentException if it does.
      Parameters:
      c - the collection to check
      argNameOrErrorMsg - the name of the argument or an error message to be used in the exception
      Throws:
      IllegalArgumentException - if null element found in c
    • checkKeyNotNull

      public static void checkKeyNotNull(Map<?,?> m) throws IllegalArgumentException
      Check if the specified Map not contains any null key, and throws IllegalArgumentException if it does.
      Parameters:
      m - the map to check
      Throws:
      IllegalArgumentException - if null key found in m
    • checkKeyNotNull

      public static void checkKeyNotNull(Map<?,?> m, String argNameOrErrorMsg) throws IllegalArgumentException
      Check if the specified Map not contains any null key, and throws IllegalArgumentException if it does.
      Parameters:
      m - the map to check
      argNameOrErrorMsg - the name of the argument or an error message to be used in the exception
      Throws:
      IllegalArgumentException - if null key found in m
    • checkValueNotNull

      public static void checkValueNotNull(Map<?,?> m) throws IllegalArgumentException
      Check if the specified Map not contains any null value, and throws IllegalArgumentException if it does.
      Parameters:
      m - the map to check
      Throws:
      IllegalArgumentException - if null value found in m
    • checkValueNotNull

      public static void checkValueNotNull(Map<?,?> m, String argNameOrErrorMsg) throws IllegalArgumentException
      Check if the specified Map not contains any null value, and throws IllegalArgumentException if it does.
      Parameters:
      m - the map to check
      argNameOrErrorMsg - the name of the argument or an error message to be used in the exception
      Throws:
      IllegalArgumentException - if null value found in m
    • checkArgument

      public static void checkArgument(boolean expression) throws IllegalArgumentException
      Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
      Parameters:
      expression - a boolean expression
      Throws:
      IllegalArgumentException - if expression is false
    • checkArgument

      public static void checkArgument(boolean expression, Object errorMessage) throws IllegalArgumentException
      Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
      Parameters:
      expression - a boolean expression
      argNameOrErrorMsg - the name of the argument or an error message to be used in the exception
      Throws:
      IllegalArgumentException - if expression is false
    • checkArgument

      public static void checkArgument(boolean expression, String errorMessageTemplate, Object... errorMessageArgs) throws IllegalArgumentException
      Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
      Parameters:
      expression - a boolean expression
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      errorMessageArgs - the arguments to be substituted into the message template. Arguments are converted to strings using String.valueOf(Object).
      Throws:
      IllegalArgumentException - if expression is false
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, char p) throws IllegalArgumentException
      Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p - the parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalArgumentException - if expression is false
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, int p) throws IllegalArgumentException
      Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p - the parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalArgumentException - if expression is false
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, long p) throws IllegalArgumentException
      Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p - the parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalArgumentException - if expression is false
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, double p) throws IllegalArgumentException
      Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p - the parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalArgumentException - if expression is false
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, Object p) throws IllegalArgumentException
      Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p - the parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalArgumentException - if expression is false
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, char p1, char p2) throws IllegalArgumentException
      Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      p - the parameter to be used in the exception message
      Throws:
      IllegalArgumentException - if expression is false
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, char p1, int p2) throws IllegalArgumentException
      Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      p - the parameter to be used in the exception message
      Throws:
      IllegalArgumentException - if expression is false
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, char p1, long p2) throws IllegalArgumentException
      Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p1 - the parameter to be used in the exception message
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalArgumentException - if expression is false
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, char p1, double p2) throws IllegalArgumentException
      Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p1 - the parameter to be used in the exception message
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalArgumentException - if expression is false
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, char p1, Object p2) throws IllegalArgumentException
      Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p1 - the parameter to be used in the exception message
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalArgumentException - if expression is false
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, int p1, char p2) throws IllegalArgumentException
      Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      p - the parameter to be used in the exception message
      Throws:
      IllegalArgumentException - if expression is false
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, int p1, int p2) throws IllegalArgumentException
      Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      p - the parameter to be used in the exception message
      Throws:
      IllegalArgumentException - if expression is false
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, int p1, long p2) throws IllegalArgumentException
      Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p1 - the parameter to be used in the exception message
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalArgumentException - if expression is false
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, int p1, double p2) throws IllegalArgumentException
      Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p1 - the parameter to be used in the exception message
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalArgumentException - if expression is false
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, int p1, Object p2) throws IllegalArgumentException
      Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p1 - the parameter to be used in the exception message
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalArgumentException - if expression is false
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, long p1, char p2) throws IllegalArgumentException
      Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      p - the parameter to be used in the exception message
      Throws:
      IllegalArgumentException - if expression is false
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, long p1, int p2) throws IllegalArgumentException
      Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      p - the parameter to be used in the exception message
      Throws:
      IllegalArgumentException - if expression is false
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, long p1, long p2) throws IllegalArgumentException
      Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p1 - the parameter to be used in the exception message
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalArgumentException - if expression is false
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, long p1, double p2) throws IllegalArgumentException
      Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p1 - the parameter to be used in the exception message
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalArgumentException - if expression is false
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, long p1, Object p2) throws IllegalArgumentException
      Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p1 - the parameter to be used in the exception message
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalArgumentException - if expression is false
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, double p1, char p2) throws IllegalArgumentException
      Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      p - the parameter to be used in the exception message
      Throws:
      IllegalArgumentException - if expression is false
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, double p1, int p2) throws IllegalArgumentException
      Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      p - the parameter to be used in the exception message
      Throws:
      IllegalArgumentException - if expression is false
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, double p1, long p2) throws IllegalArgumentException
      Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p1 - the parameter to be used in the exception message
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalArgumentException - if expression is false
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, double p1, double p2) throws IllegalArgumentException
      Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p1 - the parameter to be used in the exception message
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalArgumentException - if expression is false
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, double p1, Object p2) throws IllegalArgumentException
      Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p1 - the parameter to be used in the exception message
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalArgumentException - if expression is false
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, Object p1, char p2) throws IllegalArgumentException
      Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      p - the parameter to be used in the exception message
      Throws:
      IllegalArgumentException - if expression is false
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, Object p1, int p2) throws IllegalArgumentException
      Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      p - the parameter to be used in the exception message
      Throws:
      IllegalArgumentException - if expression is false
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, Object p1, long p2) throws IllegalArgumentException
      Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p1 - the parameter to be used in the exception message
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalArgumentException - if expression is false
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, Object p1, double p2) throws IllegalArgumentException
      Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p1 - the parameter to be used in the exception message
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalArgumentException - if expression is false
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, Object p1, Object p2) throws IllegalArgumentException
      Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p1 - the parameter to be used in the exception message
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalArgumentException - if expression is false
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, Object p1, Object p2, Object p3) throws IllegalArgumentException
      Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p1 - the parameter to be used in the exception message
      p2 - the second parameter to be used in the exception message
      p3 - the third parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalArgumentException - if expression is false
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, Object p1, Object p2, Object p3, Object p4) throws IllegalArgumentException
      Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p1 - the parameter to be used in the exception message
      p2 - the second parameter to be used in the exception message
      p3 - the third parameter to be used in the exception message
      p4 - the third parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalArgumentException - if expression is false
    • checkArgument

      public static void checkArgument(boolean b, Supplier<String> errorMessageSupplier) throws IllegalArgumentException
      Check if the specified expression involving one or more parameters of the calling method is true, and throws IllegalArgumentException if it is not.
      Parameters:
      errorMessageSupplier - a supplier of the exception message to use if the check fails; will not be invoked if the check passes
      expression - a boolean expression
      Throws:
      IllegalArgumentException - if expression is false
    • checkState

      public static void checkState(boolean expression) throws IllegalStateException
      Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
      Parameters:
      expression - a boolean expression
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean expression, Object errorMessage) throws IllegalStateException
      Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
      Parameters:
      expression - a boolean expression
      argNameOrErrorMsg - the name of the argument or an error message to be used in the exception
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean expression, String errorMessageTemplate, Object... errorMessageArgs) throws IllegalStateException
      Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
      Parameters:
      expression - a boolean expression
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      errorMessageArgs - the arguments to be substituted into the message template. Arguments are converted to strings using String.valueOf(Object).
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, char p) throws IllegalStateException
      Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p - the parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, int p) throws IllegalStateException
      Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p - the parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, long p) throws IllegalStateException
      Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p - the parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, double p) throws IllegalStateException
      Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p - the parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, Object p) throws IllegalStateException
      Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p - the parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, char p1, char p2) throws IllegalStateException
      Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      p - the parameter to be used in the exception message
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, char p1, int p2) throws IllegalStateException
      Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      p - the parameter to be used in the exception message
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, char p1, long p2) throws IllegalStateException
      Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p1 - the parameter to be used in the exception message
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, char p1, double p2) throws IllegalStateException
      Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p1 - the parameter to be used in the exception message
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, char p1, Object p2) throws IllegalStateException
      Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p1 - the parameter to be used in the exception message
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, int p1, char p2) throws IllegalStateException
      Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      p - the parameter to be used in the exception message
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, int p1, int p2) throws IllegalStateException
      Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      p - the parameter to be used in the exception message
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, int p1, long p2) throws IllegalStateException
      Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p1 - the parameter to be used in the exception message
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, int p1, double p2) throws IllegalStateException
      Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p1 - the parameter to be used in the exception message
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, int p1, Object p2) throws IllegalStateException
      Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p1 - the parameter to be used in the exception message
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, long p1, char p2) throws IllegalStateException
      Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      p - the parameter to be used in the exception message
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, long p1, int p2) throws IllegalStateException
      Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      p - the parameter to be used in the exception message
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, long p1, long p2) throws IllegalStateException
      Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p1 - the parameter to be used in the exception message
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, long p1, double p2) throws IllegalStateException
      Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p1 - the parameter to be used in the exception message
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, long p1, Object p2) throws IllegalStateException
      Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p1 - the parameter to be used in the exception message
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, double p1, char p2) throws IllegalStateException
      Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      p - the parameter to be used in the exception message
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, double p1, int p2) throws IllegalStateException
      Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      p - the parameter to be used in the exception message
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, double p1, long p2) throws IllegalStateException
      Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p1 - the parameter to be used in the exception message
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, double p1, double p2) throws IllegalStateException
      Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p1 - the parameter to be used in the exception message
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, double p1, Object p2) throws IllegalStateException
      Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p1 - the parameter to be used in the exception message
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, Object p1, char p2) throws IllegalStateException
      Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      p - the parameter to be used in the exception message
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, Object p1, int p2) throws IllegalStateException
      Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      p - the parameter to be used in the exception message
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, Object p1, long p2) throws IllegalStateException
      Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p1 - the parameter to be used in the exception message
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, Object p1, double p2) throws IllegalStateException
      Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p1 - the parameter to be used in the exception message
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, Object p1, Object p2) throws IllegalStateException
      Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p1 - the parameter to be used in the exception message
      p2 - the second parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, Object p1, Object p2, Object p3) throws IllegalStateException
      Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p1 - the parameter to be used in the exception message
      p2 - the second parameter to be used in the exception message
      p3 - the third parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, Object p1, Object p2, Object p3, Object p4) throws IllegalStateException
      Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
      Parameters:
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each {} or %s placeholder in the template with an argument.
      p1 - the parameter to be used in the exception message
      p2 - the second parameter to be used in the exception message
      p3 - the third parameter to be used in the exception message
      p4 - the third parameter to be used in the exception message
      expression - a boolean expression
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean b, Supplier<String> errorMessageSupplier) throws IllegalStateException
      Check if the specified expression involving the state check of the calling instance is true, and throws IllegalStateException if it is not.
      Parameters:
      errorMessageSupplier - a supplier of the exception message to use if the check fails; will not be invoked if the check passes
      expression - a boolean expression
      Throws:
      IllegalStateException - if expression is false
    • requireNonNull

      @Beta public static <T> T requireNonNull(T obj) throws NullPointerException
      Checks if the specified object reference is not null, and throws NullPointerException if it is.
      Type Parameters:
      T - the type of the object
      Parameters:
      obj - the object reference to check for nullity
      Returns:
      the non-null object reference that was validated
      Throws:
      NullPointerException - if the specified obj is null
      See Also:
    • requireNonNull

      @Beta public static <T> T requireNonNull(T obj, String errorMessage) throws NullPointerException
      Checks if the specified object reference is not null, and throws NullPointerException if it is.
      Type Parameters:
      T - the type of the object
      Parameters:
      obj - the object reference to check for nullity
      errorMessage - the detail message to be used in the event that a NullPointerException is thrown
      Returns:
      the non-null object reference that was validated
      Throws:
      NullPointerException - if the specified obj is null
      See Also:
    • requireNonNull

      @Beta public static <T> T requireNonNull(T obj, Supplier<String> errorMessageSupplier) throws NullPointerException
      Checks if the specified object reference is not null, and throws NullPointerException if it is.
      Type Parameters:
      T - the type of the object
      Parameters:
      obj - the object reference to check for nullity
      errorMessageSupplier - the supplier of the detail message to be used in the event that a NullPointerException is thrown
      Returns:
      the non-null object reference that was validated
      Throws:
      NullPointerException - if the specified obj is null
      See Also:
    • compare

      public static int compare(boolean a, boolean b)
      Compares two boolean values.
      Parameters:
      a - the first boolean value
      b - the second boolean value
      Returns:
      0 if both values are equal, 1 if the first value is true and the second is false, -1 if the first value is false and the second is true
    • compare

      public static int compare(char a, char b)
      Compares two char values.
      Parameters:
      a - the first char value
      b - the second char value
      Returns:
      0 if both values are equal, 1 if the first value is greater than the second, -1 if the first value is less than the second
    • compare

      public static int compare(byte a, byte b)
      Compares two byte values.
      Parameters:
      a - the first byte value
      b - the second byte value
      Returns:
      0 if both values are equal, 1 if the first value is greater than the second, -1 if the first value is less than the second
    • compareUnsigned

      public static int compareUnsigned(byte a, byte b)
      Compares two unsigned byte values.
      Parameters:
      a - the first byte value
      b - the second byte value
      Returns:
      0 if both values are equal, 1 if the first value is greater than the second, -1 if the first value is less than the second
      See Also:
    • compare

      public static int compare(short a, short b)
      Compares two short values.
      Parameters:
      a - the first short value
      b - the second short value
      Returns:
      0 if both values are equal, 1 if the first value is greater than the second, -1 if the first value is less than the second
    • compareUnsigned

      public static int compareUnsigned(short a, short b)
      Compares two unsigned short values.
      Parameters:
      a - the first short value
      b - the second short value
      Returns:
      0 if both values are equal, 1 if the first value is greater than the second, -1 if the first value is less than the second
      See Also:
    • compare

      public static int compare(int a, int b)
      Compares two int values.
      Parameters:
      a - the first int value
      b - the second int value
      Returns:
      0 if both values are equal, 1 if the first value is greater than the second, -1 if the first value is less than the second
    • compareUnsigned

      public static int compareUnsigned(int a, int b)
      Compares two unsigned int values.
      Parameters:
      a - the first int value
      b - the second int value
      Returns:
      0 if both values are equal, 1 if the first value is greater than the second, -1 if the first value is less than the second
      See Also:
    • compare

      public static int compare(long a, long b)
      Compares two long values.
      Parameters:
      a - the first long value
      b - the second long value
      Returns:
      0 if both values are equal, 1 if the first value is greater than the second, -1 if the first value is less than the second
    • compareUnsigned

      public static int compareUnsigned(long a, long b)
      Compares two unsigned long values.
      Parameters:
      a - the first long value
      b - the second long value
      Returns:
      0 if both values are equal, 1 if the first value is greater than the second, -1 if the first value is less than the second
      See Also:
    • compare

      public static int compare(float a, float b)
      Compares two float values.
      Parameters:
      a - the first float value
      b - the second float value
      Returns:
      0 if both values are equal, 1 if the first value is greater than the second, -1 if the first value is less than the second
    • compare

      public static int compare(double a, double b)
      Compares two double values.
      Parameters:
      a - the first double value
      b - the second double value
      Returns:
      0 if both values are equal, 1 if the first value is greater than the second, -1 if the first value is less than the second
    • compare

      public static <T extends Comparable<? super T>> int compare(T a, T b)
      Compares two Comparable object values. (null is considered as the smallest value in nature order).
      Parameters:
      a - the first object value
      b - the second object value
      Returns:
      0 if both values are equal, 1 if the first value is greater than the second, -1 if the first value is less than the second
    • compare

      public static <T> int compare(T a, T b, Comparator<? super T> cmp)
      Compares two Comparable object values using the specified Comparator.
      Type Parameters:
      T -
      Parameters:
      a - the first object value
      b - the second object value
      cmp - the comparator to be used
      Returns:
      0 if both values are equal, 1 if the first value is greater than the second, -1 if the first value is less than the second
    • compare

      public static <T1 extends Comparable<T1>, T2 extends Comparable<T2>> int compare(T1 a1, T1 b1, T2 a2, T2 b2)
      Compares two pairs of values (a1, b1) and (a2, b2) until they are not equal. (null is considered as the smallest value in nature order). Returns 0 if all pairs of values are equal.
      Type Parameters:
      T1 - the type of the first pair of values, which must be comparable
      T2 - the type of the second pair of values, which must be comparable
      Parameters:
      a1 - the first value of the first pair
      b1 - the second value of the first pair
      a2 - the first value of the second pair
      b2 - the second value of the second pair
      Returns:
      a negative integer, zero, or a positive integer as the first value is less than, equal to, or greater than the second values in the specified pairs.
    • compare

      public static <T1 extends Comparable<T1>, T2 extends Comparable<T2>, T3 extends Comparable<T3>> int compare(T1 a1, T1 b1, T2 a2, T2 b2, T3 a3, T3 b3)
      Compares three pairs of values (a1, b1), (a2, b2), and (a3, b3) until they are not equal. (null is considered as the smallest value in nature order). Returns 0 if all pairs of values are equal.
      Type Parameters:
      T1 - the type of the first pair of values, which must be comparable
      T2 - the type of the second pair of values, which must be comparable
      T3 - the type of the third pair of values, which must be comparable
      Parameters:
      a1 - the first value of the first pair
      b1 - the second value of the first pair
      a2 - the first value of the second pair
      b2 - the second value of the second pair
      a3 - the first value of the third pair
      b3 - the second value of the third pair
      Returns:
      a negative integer, zero, or a positive integer as the first value is less than, equal to, or greater than the second values in the specified pairs.
    • compare

      @Deprecated public static <T1 extends Comparable<T1>, T2 extends Comparable<T2>, T3 extends Comparable<T3>, T4 extends Comparable<T4>> int compare(T1 a1, T1 b1, T2 a2, T2 b2, T3 a3, T3 b3, T4 a4, T4 b4)
      Compares four pairs of values (a1, b1), (a2, b2), (a3, b3), and (a4, b4) until they are not equal. (null is considered as the smallest value in nature order). Returns 0 if all pairs of values are equal.
      Type Parameters:
      T1 - the type of the first pair of values, which must be comparable
      T2 - the type of the second pair of values, which must be comparable
      T3 - the type of the third pair of values, which must be comparable
      T4 - the type of the fourth pair of values, which must be comparable
      Parameters:
      a1 - the first value of the first pair
      b1 - the second value of the first pair
      a2 - the first value of the second pair
      b2 - the second value of the second pair
      a3 - the first value of the third pair
      b3 - the second value of the third pair
      a4 - the first value of the fourth pair
      b4 - the second value of the fourth pair
      Returns:
      a negative integer, zero, or a positive integer as the first value is less than, equal to, or greater than the second values in the specified pairs.
      See Also:
    • compare

      @Deprecated public static <T1 extends Comparable<T1>, T2 extends Comparable<T2>, T3 extends Comparable<T3>, T4 extends Comparable<T4>, T5 extends Comparable<T5>> int compare(T1 a1, T1 b1, T2 a2, T2 b2, T3 a3, T3 b3, T4 a4, T4 b4, T5 a5, T5 b5)
      Compares five pairs of values (a1, b1), (a2, b2), (a3, b3), (a4, b4), and (a5, b5) until they are not equal. (null is considered as the smallest value in nature order). Returns 0 if all pairs of values are equal.
      Type Parameters:
      T1 - the type of the first pair of values, which must be comparable
      T2 - the type of the second pair of values, which must be comparable
      T3 - the type of the third pair of values, which must be comparable
      T4 - the type of the fourth pair of values, which must be comparable
      T5 - the type of the fifth pair of values, which must be comparable
      Parameters:
      a1 - the first value of the first pair
      b1 - the second value of the first pair
      a2 - the first value of the second pair
      b2 - the second value of the second pair
      a3 - the first value of the third pair
      b3 - the second value of the third pair
      a4 - the first value of the fourth pair
      b4 - the second value of the fourth pair
      a5 - the first value of the fifth pair
      b5 - the second value of the fifth pair
      Returns:
      a negative integer, zero, or a positive integer as the first value is less than, equal to, or greater than the second values in the specified pairs.
      See Also:
    • compare

      @Deprecated public static <T1 extends Comparable<T1>, T2 extends Comparable<T2>, T3 extends Comparable<T3>, T4 extends Comparable<T4>, T5 extends Comparable<T5>, T6 extends Comparable<T6>> int compare(T1 a1, T1 b1, T2 a2, T2 b2, T3 a3, T3 b3, T4 a4, T4 b4, T5 a5, T5 b5, T6 a6, T6 b6)
      Compares six pairs of values (a1, b1), (a2, b2), (a3, b3), (a4, b4), (a5, b5), and (a6, b6) until they are not equal. (null is considered as the smallest value in nature order). Returns 0 if all pairs of values are equal.
      Type Parameters:
      T1 - the type of the first pair of values, which must be comparable
      T2 - the type of the second pair of values, which must be comparable
      T3 - the type of the third pair of values, which must be comparable
      T4 - the type of the fourth pair of values, which must be comparable
      T5 - the type of the fifth pair of values, which must be comparable
      T6 - the type of the sixth pair of values, which must be comparable
      Parameters:
      a1 - the first value of the first pair
      b1 - the second value of the first pair
      a2 - the first value of the second pair
      b2 - the second value of the second pair
      a3 - the first value of the third pair
      b3 - the second value of the third pair
      a4 - the first value of the fourth pair
      b4 - the second value of the fourth pair
      a5 - the first value of the fifth pair
      b5 - the second value of the fifth pair
      a6 - the first value of the sixth pair
      b6 - the second value of the sixth pair
      Returns:
      a negative integer, zero, or a positive integer as the first value is less than, equal to, or greater than the second values in the specified pairs.
      See Also:
    • compare

      @Deprecated public static <T1 extends Comparable<T1>, T2 extends Comparable<T2>, T3 extends Comparable<T3>, T4 extends Comparable<T4>, T5 extends Comparable<T5>, T6 extends Comparable<T6>, T7 extends Comparable<T7>> int compare(T1 a1, T1 b1, T2 a2, T2 b2, T3 a3, T3 b3, T4 a4, T4 b4, T5 a5, T5 b5, T6 a6, T6 b6, T7 a7, T7 b7)
      Compares seven pairs of values (a1, b1), (a2, b2), (a3, b3), (a4, b4), (a5, b5), (a6, b6), and (a7, b7) until they are not equal. (null is considered as the smallest value in nature order). Returns 0 if all pairs of values are equal.
      Type Parameters:
      T1 - the type of the first pair of values, which must be comparable
      T2 - the type of the second pair of values, which must be comparable
      T3 - the type of the third pair of values, which must be comparable
      T4 - the type of the fourth pair of values, which must be comparable
      T5 - the type of the fifth pair of values, which must be comparable
      T6 - the type of the sixth pair of values, which must be comparable
      T7 - the type of the seventh pair of values, which must be comparable
      Parameters:
      a1 - the first value of the first pair
      b1 - the second value of the first pair
      a2 - the first value of the second pair
      b2 - the second value of the second pair
      a3 - the first value of the third pair
      b3 - the second value of the third pair
      a4 - the first value of the fourth pair
      b4 - the second value of the fourth pair
      a5 - the first value of the fifth pair
      b5 - the second value of the fifth pair
      a6 - the first value of the sixth pair
      b6 - the second value of the sixth pair
      a7 - the first value of the seventh pair
      b7 - the second value of the seventh pair
      Returns:
      a negative integer, zero, or a positive integer as the first value is less than, equal to, or greater than the second values in the specified pairs
      See Also:
    • compare

      public static int compare(boolean[] a, boolean[] b)
      Compares two arrays lexicographically.
      Parameters:
      a - the first array to compare
      b - the second array to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second
    • compare

      public static int compare(boolean[] a, int fromIndexA, boolean[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two arrays lexicographically over the specified range.
      Parameters:
      a - the first array to compare
      fromIndexA - the starting index in the first array
      b - the second array to compare
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second array
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified ranges are out of bounds
    • compare

      public static int compare(char[] a, char[] b)
      Compares two arrays lexicographically.
      Parameters:
      a - the first array to compare
      b - the second array to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second
    • compare

      public static int compare(char[] a, int fromIndexA, char[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two arrays lexicographically over the specified range.
      Parameters:
      a - the first array to compare
      fromIndexA - the starting index in the first array
      b - the second array to compare
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second array
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified ranges are out of bounds
    • compare

      public static int compare(byte[] a, byte[] b)
      Compares two arrays lexicographically.
      Parameters:
      a - the first array to compare
      b - the second array to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second
    • compare

      public static int compare(byte[] a, int fromIndexA, byte[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two arrays lexicographically over the specified range.
      Parameters:
      a - the first array to compare
      fromIndexA - the starting index in the first array
      b - the second array to compare
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second array
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified ranges are out of bounds
    • compareUnsigned

      public static int compareUnsigned(byte[] a, byte[] b)
      Compares two arrays lexicographically, treating the values as unsigned.
      Parameters:
      a - the first array to compare
      b - the second array to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second
      See Also:
    • compareUnsigned

      public static int compareUnsigned(byte[] a, int fromIndexA, byte[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two subarrays lexicographically, treating the values as unsigned.
      Parameters:
      a - the first array to compare
      fromIndexA - the starting index (inclusive) of the first subarray
      b - the second array to compare
      fromIndexB - the starting index (inclusive) of the second subarray
      len - the length of the subarrays to compare
      Returns:
      a negative integer, zero, or a positive integer as the first subarray is less than, equal to, or greater than the second subarray
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified indices are out of bounds
      See Also:
    • compare

      public static int compare(short[] a, short[] b)
      Compares two arrays lexicographically.
      Parameters:
      a - the first array to compare
      b - the second array to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second
    • compare

      public static int compare(short[] a, int fromIndexA, short[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two arrays lexicographically over the specified range.
      Parameters:
      a - the first array to compare
      fromIndexA - the starting index in the first array
      b - the second array to compare
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second array
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified ranges are out of bounds
    • compareUnsigned

      public static int compareUnsigned(short[] a, short[] b)
      Compares two arrays lexicographically, treating the values as unsigned.
      Parameters:
      a - the first array to compare
      b - the second array to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second
      See Also:
    • compareUnsigned

      public static int compareUnsigned(short[] a, int fromIndexA, short[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two subarrays lexicographically, treating the values as unsigned.
      Parameters:
      a - the first array to compare
      fromIndexA - the starting index (inclusive) of the first subarray
      b - the second array to compare
      fromIndexB - the starting index (inclusive) of the second subarray
      len - the length of the subarrays to compare
      Returns:
      a negative integer, zero, or a positive integer as the first subarray is less than, equal to, or greater than the second subarray
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified indices are out of bounds
      See Also:
    • compare

      public static int compare(int[] a, int[] b)
      Compares two arrays lexicographically.
      Parameters:
      a - the first array to compare
      b - the second array to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second
    • compare

      public static int compare(int[] a, int fromIndexA, int[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two arrays lexicographically over the specified range.
      Parameters:
      a - the first array to compare
      fromIndexA - the starting index in the first array
      b - the second array to compare
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second array
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified ranges are out of bounds
    • compareUnsigned

      public static int compareUnsigned(int[] a, int[] b)
      Compares two arrays lexicographically, treating the values as unsigned.
      Parameters:
      a - the first array to compare
      b - the second array to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second
      See Also:
    • compareUnsigned

      public static int compareUnsigned(int[] a, int fromIndexA, int[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two subarrays lexicographically, treating the values as unsigned.
      Parameters:
      a - the first array to compare
      fromIndexA - the starting index (inclusive) of the first subarray
      b - the second array to compare
      fromIndexB - the starting index (inclusive) of the second subarray
      len - the length of the subarrays to compare
      Returns:
      a negative integer, zero, or a positive integer as the first subarray is less than, equal to, or greater than the second subarray
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified indices are out of bounds
      See Also:
    • compare

      public static int compare(long[] a, long[] b)
      Compares two arrays lexicographically.
      Parameters:
      a - the first array to compare
      b - the second array to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second
    • compare

      public static int compare(long[] a, int fromIndexA, long[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two arrays lexicographically over the specified range.
      Parameters:
      a - the first array to compare
      fromIndexA - the starting index in the first array
      b - the second array to compare
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second array
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified ranges are out of bounds
    • compareUnsigned

      public static int compareUnsigned(long[] a, long[] b)
      Compares two arrays lexicographically, treating the values as unsigned.
      Parameters:
      a - the first array to compare
      b - the second array to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second
      See Also:
    • compareUnsigned

      public static int compareUnsigned(long[] a, int fromIndexA, long[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two subarrays lexicographically, treating the values as unsigned.
      Parameters:
      a - the first array to compare
      fromIndexA - the starting index (inclusive) of the first subarray
      b - the second array to compare
      fromIndexB - the starting index (inclusive) of the second subarray
      len - the length of the subarrays to compare
      Returns:
      a negative integer, zero, or a positive integer as the first subarray is less than, equal to, or greater than the second subarray
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified indices are out of bounds
      See Also:
    • compare

      public static int compare(float[] a, float[] b)
      Compares two arrays lexicographically.
      Parameters:
      a - the first array to compare
      b - the second array to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second
    • compare

      public static int compare(float[] a, int fromIndexA, float[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two arrays lexicographically over the specified range.
      Parameters:
      a - the first array to compare
      fromIndexA - the starting index in the first array
      b - the second array to compare
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second array
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified ranges are out of bounds
    • compare

      public static int compare(double[] a, double[] b)
      Compares two arrays lexicographically.
      Parameters:
      a - the first array to compare
      b - the second array to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second
    • compare

      public static int compare(double[] a, int fromIndexA, double[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two arrays lexicographically over the specified range.
      Parameters:
      a - the first array to compare
      fromIndexA - the starting index in the first array
      b - the second array to compare
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second array
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified ranges are out of bounds
    • compare

      public static <T extends Comparable<? super T>> int compare(T[] a, T[] b)
      Compares two arrays lexicographically. (null is considered as the smallest value in nature order).
      Parameters:
      a - the first array to compare
      b - the second array to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second
    • compare

      public static <T extends Comparable<? super T>> int compare(T[] a, int fromIndexA, T[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two arrays lexicographically over the specified range. (null is considered as the smallest value in nature order).
      Parameters:
      a - the first array to compare
      fromIndexA - the starting index in the first array
      b - the second array to compare
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second array
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified ranges are out of bounds
    • compare

      public static <T> int compare(T[] a, T[] b, Comparator<? super T> cmp)
      Compares two arrays using the specified comparator.
      Type Parameters:
      T - the type of elements in the arrays
      Parameters:
      a - the first array to compare
      b - the second array to compare
      cmp - the comparator to compare array elements
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second array
    • compare

      public static <T> int compare(T[] a, int fromIndexA, T[] b, int fromIndexB, int len, Comparator<? super T> cmp) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two arrays lexicographically over the specified range using the specified comparator.
      Parameters:
      a - the first array to compare
      fromIndexA - the starting index in the first array
      b - the second array to compare
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      cmp - the comparator to compare array elements
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second array
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified ranges are out of bounds
    • compare

      public static <T> int compare(Collection<T> a, int fromIndexA, Collection<T> b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two collections lexicographically over the specified range. (null is considered as the smallest value in nature order).
      Parameters:
      a - the first collection to compare
      fromIndexA - the starting index in the first collection
      b - the second collection to compare
      fromIndexB - the starting index in the second collection
      len - the number of elements to compare
      Returns:
      a negative integer, zero, or a positive integer as the first collection is less than, equal to, or greater than the second collection
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified ranges are out of bounds
    • compare

      public static <T extends Comparable<? super T>> int compare(Iterable<T> a, Iterable<T> b)
      Compares two iterables lexicographically. (null is considered as the smallest value in nature order).
      Type Parameters:
      T - the type of elements in the iterables, which must be comparable
      Parameters:
      a - the first iterable to compare
      b - the second iterable to compare
      Returns:
      a negative integer, zero, or a positive integer as the first iterable is less than, equal to, or greater than the second iterable
    • compare

      public static <T extends Comparable<? super T>> int compare(Iterator<T> a, Iterator<T> b)
      Compares two iterators lexicographically. (null is considered as the smallest value in nature order).
      Type Parameters:
      T - the type of elements in the iterators, which must be comparable
      Parameters:
      a - the first iterator to compare
      b - the second iterator to compare
      Returns:
      a negative integer, zero, or a positive integer as the first iterator is less than, equal to, or greater than the second iterator
    • compare

      public static <T> int compare(Collection<T> a, int fromIndexA, Collection<T> b, int fromIndexB, int len, Comparator<? super T> cmp) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two collections lexicographically over the specified range using the specified comparator.
      Type Parameters:
      T - the type of elements in the collections
      Parameters:
      a - the first collection to compare
      fromIndexA - the starting index in the first collection
      b - the second collection to compare
      fromIndexB - the starting index in the second collection
      len - the number of elements to compare
      cmp - the comparator to compare collection elements
      Returns:
      a negative integer, zero, or a positive integer as the first collection is less than, equal to, or greater than the second collection
      Throws:
      IllegalArgumentException - if the specified length is negative
      IndexOutOfBoundsException - if the specified indices are out of range
    • compare

      public static <T> int compare(Iterable<T> a, Iterable<T> b, Comparator<? super T> cmp)
      Compares two iterables using the specified comparator.
      Type Parameters:
      T - the type of elements in the iterables
      Parameters:
      a - the first iterable to compare
      b - the second iterable to compare
      cmp - the comparator to compare elements from iterables
      Returns:
      a negative integer, zero, or a positive integer as the first iterable is less than, equal to, or greater than the second iterable
    • compare

      public static <T> int compare(Iterator<T> a, Iterator<T> b, Comparator<? super T> cmp)
      Compares two iterators using the specified comparator.
      Type Parameters:
      T - the type of elements in the iterators
      Parameters:
      a - the first iterator to compare
      b - the second iterator to compare
      cmp - the comparator to compare elements from iterators
      Returns:
      a negative integer, zero, or a positive integer as the first iterator is less than, equal to, or greater than the second iterator
    • compareIgnoreCase

      public static int compareIgnoreCase(String a, String b)
      Compares two strings lexicographically, ignoring case differences.
      Parameters:
      a - the first string to compare
      b - the second string to compare
      Returns:
      a negative integer, zero, or a positive integer as the first string is less than, equal to, or greater than the second string, ignoring case considerations
    • compareIgnoreCase

      public static int compareIgnoreCase(String[] a, String[] b)
      Compares two arrays of strings lexicographically, ignoring case differences.
      Parameters:
      a - the first array of strings to compare
      b - the second array of strings to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second array, ignoring case considerations
    • compareByProps

      @Deprecated public static int compareByProps(@NotNull Object bean1, @NotNull Object bean2, Collection<String> propNamesToCompare)
      Deprecated.
      call getPropValue by reflection APIs during comparing or sorting may have a huge impact on performance. Use Builder.ComparisonBuilder instead.
      Compares two beans based on the specified properties.
      Parameters:
      bean1 - the first bean to compare, must not be null
      bean2 - the second bean to compare, must not be null
      propNamesToCompare - the collection of property names to compare, may be null
      Returns:
      a negative integer, zero, or a positive integer as the first bean is less than, equal to, or greater than the second bean
      Throws:
      IllegalArgumentException - if any of the arguments are null
      See Also:
    • mismatch

      public static int mismatch(boolean[] a, boolean[] b)
      Finds and returns the index of the first mismatch between two arrays. If the arrays are identical or both are null or empty, returns -1.
      Parameters:
      a - the first boolean array
      b - the second boolean array
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical or both are null or empty.
      See Also:
    • mismatch

      public static int mismatch(boolean[] a, int fromIndexA, boolean[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Finds and returns the index of the first mismatch between two boolean arrays starting from specified indices. If the arrays are identical in the specified range, returns -1.
      Parameters:
      a - the first boolean array
      fromIndexA - the starting index in the first array
      b - the second boolean array
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical in the specified range
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the starting indices or length are out of bounds
      See Also:
    • mismatch

      public static int mismatch(char[] a, char[] b)
      Finds and returns the index of the first mismatch between two arrays. If the arrays are identical or both are null or empty, returns -1.
      Parameters:
      a - the first char array
      b - the second char array
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical or both are null or empty.
      See Also:
    • mismatch

      public static int mismatch(char[] a, int fromIndexA, char[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Finds and returns the index of the first mismatch between two char arrays starting from specified indices. If the arrays are identical in the specified range, returns -1.
      Parameters:
      a - the first char array
      fromIndexA - the starting index in the first array
      b - the second char array
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical in the specified range
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the starting indices or length are out of bounds
      See Also:
    • mismatch

      public static int mismatch(byte[] a, byte[] b)
      Finds and returns the index of the first mismatch between two arrays. If the arrays are identical or both are null or empty, returns -1.
      Parameters:
      a - the first byte array
      b - the second byte array
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical or both are null or empty.
      See Also:
    • mismatch

      public static int mismatch(byte[] a, int fromIndexA, byte[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Finds and returns the index of the first mismatch between two byte arrays starting from specified indices. If the arrays are identical in the specified range, returns -1.
      Parameters:
      a - the first byte array
      fromIndexA - the starting index in the first array
      b - the second byte array
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical in the specified range
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the starting indices or length are out of bounds
      See Also:
    • mismatch

      public static int mismatch(short[] a, short[] b)
      Finds and returns the index of the first mismatch between two arrays. If the arrays are identical or both are null or empty, returns -1.
      Parameters:
      a - the first short array
      b - the second short array
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical or both are null or empty.
      See Also:
    • mismatch

      public static int mismatch(short[] a, int fromIndexA, short[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Finds and returns the index of the first mismatch between two short arrays starting from specified indices. If the arrays are identical in the specified range, returns -1.
      Parameters:
      a - the first short array
      fromIndexA - the starting index in the first array
      b - the second short array
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical in the specified range
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the starting indices or length are out of bounds
      See Also:
    • mismatch

      public static int mismatch(int[] a, int[] b)
      Finds and returns the index of the first mismatch between two arrays. If the arrays are identical or both are null or empty, returns -1.
      Parameters:
      a - the first int array
      b - the second int array
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical or both are null or empty.
      See Also:
    • mismatch

      public static int mismatch(int[] a, int fromIndexA, int[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Finds and returns the index of the first mismatch between two int arrays starting from specified indices. If the arrays are identical in the specified range, returns -1.
      Parameters:
      a - the first int array
      fromIndexA - the starting index in the first array
      b - the second int array
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical in the specified range
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the starting indices or length are out of bounds
      See Also:
    • mismatch

      public static int mismatch(long[] a, long[] b)
      Finds and returns the index of the first mismatch between two arrays. If the arrays are identical or both are null or empty, returns -1.
      Parameters:
      a - the first long array
      b - the second long array
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical or both are null or empty.
      See Also:
    • mismatch

      public static int mismatch(long[] a, int fromIndexA, long[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Finds and returns the index of the first mismatch between two long arrays starting from specified indices. If the arrays are identical in the specified range, returns -1.
      Parameters:
      a - the first long array
      fromIndexA - the starting index in the first array
      b - the second long array
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical in the specified range
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the starting indices or length are out of bounds
      See Also:
    • mismatch

      public static int mismatch(float[] a, float[] b)
      Finds and returns the index of the first mismatch between two arrays. If the arrays are identical or both are null or empty, returns -1.
      Parameters:
      a - the first float array
      b - the second float array
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical or both are null or empty.
      See Also:
    • mismatch

      public static int mismatch(float[] a, int fromIndexA, float[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Finds and returns the index of the first mismatch between two float arrays starting from specified indices. If the arrays are identical in the specified range, returns -1.
      Parameters:
      a - the first float array
      fromIndexA - the starting index in the first array
      b - the second float array
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical in the specified range
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the starting indices or length are out of bounds
      See Also:
    • mismatch

      public static int mismatch(double[] a, double[] b)
      Finds and returns the index of the first mismatch between two arrays. If the arrays are identical or both are null or empty, returns -1.
      Parameters:
      a - the first double array
      b - the second double array
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical or both are null or empty.
      See Also:
    • mismatch

      public static int mismatch(double[] a, int fromIndexA, double[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Finds and returns the index of the first mismatch between two double arrays starting from specified indices. If the arrays are identical in the specified range, returns -1.
      Parameters:
      a - the first double array
      fromIndexA - the starting index in the first array
      b - the second double array
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical in the specified range
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the starting indices or length are out of bounds
      See Also:
    • mismatch

      public static <T extends Comparable<? super T>> int mismatch(T[] a, T[] b)
      Finds and returns the index of the first mismatch between two arrays. If the arrays are identical or both are null or empty, returns -1.
      Type Parameters:
      T - the type of elements in the arrays, which must be Comparable
      Parameters:
      a - the first array
      b - the second array
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical or both are null or empty.
      See Also:
    • mismatch

      public static <T extends Comparable<? super T>> int mismatch(T[] a, int fromIndexA, T[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Finds and returns the index of the first mismatch between two arrays starting from specified indices. If the arrays are identical in the specified range, returns -1.
      Parameters:
      a - the first array
      fromIndexA - the starting index in the first array
      b - the second array
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical in the specified range
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the starting indices or length are out of bounds
      See Also:
    • mismatch

      public static <T> int mismatch(T[] a, T[] b, Comparator<? super T> cmp)
      Finds and returns the index of the first mismatch between two arrays. If the arrays are identical or both are null or empty, returns -1.
      Type Parameters:
      T - the type of elements in the arrays, which must be Comparable
      Parameters:
      a - the first array
      b - the second array
      cmp - the comparator to compare array elements
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical or both are null or empty.
      See Also:
    • mismatch

      public static <T> int mismatch(T[] a, int fromIndexA, T[] b, int fromIndexB, int len, Comparator<? super T> cmp) throws IllegalArgumentException, IndexOutOfBoundsException
      Finds and returns the index of the first mismatch between two arrays starting from specified indices. If the arrays are identical in the specified range, returns -1.
      Parameters:
      a - the first array
      fromIndexA - the starting index in the first array
      b - the second array
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      cmp - the comparator to compare array elements
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical in the specified range
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the starting indices or length are out of bounds
      See Also:
    • mismatch

      public static <T> int mismatch(Collection<T> a, int fromIndexA, Collection<T> b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Finds and returns the index of the first mismatch between two collections starting from specified indices. If the collections are identical in the specified range, returns -1.
      Type Parameters:
      T - the type of elements in the collections
      Parameters:
      a - the first collection
      fromIndexA - the starting index in the first collection
      b - the second collection
      fromIndexB - the starting index in the second collection
      len - the number of elements to compare
      Returns:
      the index of the first mismatch, or -1 if the collections are identical in the specified range
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the starting indices or length are out of bounds
      See Also:
    • mismatch

      public static <T extends Comparable<? super T>> int mismatch(Iterable<T> a, Iterable<T> b)
      Finds and returns the index of the first mismatch between two iterables. If the iterables are identical or both are null or empty, returns -1.
      Type Parameters:
      T - the type of elements in the iterables
      Parameters:
      a - the first iterable
      b - the second iterable
      Returns:
      the index of the first mismatch, or -1 if the iterables are identical or both are null or empty
      See Also:
    • mismatch

      public static <T extends Comparable<? super T>> int mismatch(Iterator<T> a, Iterator<T> b)
      Finds and returns the index of the first mismatch between two iterators. If the iterators are identical or both are null or empty, returns -1.
      Type Parameters:
      T - the type of elements in the iterators
      Parameters:
      a - the first iterator
      b - the second iterator
      Returns:
      the index of the first mismatch, or -1 if the iterators are identical or both are null or empty
      See Also:
    • mismatch

      public static <T> int mismatch(Collection<T> a, int fromIndexA, Collection<T> b, int fromIndexB, int len, Comparator<? super T> cmp) throws IllegalArgumentException, IndexOutOfBoundsException
      Finds and returns the index of the first mismatch between two collections starting from specified indices. If the collections are identical in the specified range, returns -1.
      Type Parameters:
      T - the type of elements in the collections
      Parameters:
      a - the first collection
      fromIndexA - the starting index in the first collection
      b - the second collection
      fromIndexB - the starting index in the second collection
      len - the number of elements to compare
      cmp - the comparator to compare elements
      Returns:
      the index of the first mismatch, or -1 if the collections are identical in the specified range
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the starting indices or length are out of bounds
      See Also:
    • mismatch

      public static <T> int mismatch(Iterable<T> a, Iterable<T> b, Comparator<? super T> cmp)
      Finds and returns the index of the first mismatch between two iterables using the specified comparator. If the iterables are identical or both are null or empty, returns -1.
      Type Parameters:
      T - the type of elements in the iterables
      Parameters:
      a - the first iterable
      b - the second iterable
      cmp - the comparator to compare elements
      Returns:
      the index of the first mismatch, or -1 if the iterables are identical or both are null or empty
      See Also:
    • mismatch

      public static <T> int mismatch(Iterator<T> a, Iterator<T> b, Comparator<? super T> cmp)
      Finds and returns the index of the first mismatch between two iterators using the specified comparator. If the iterators are identical or both are null or empty, returns -1.
      Type Parameters:
      T - the type of elements in the iterators
      Parameters:
      a - the first iterator
      b - the second iterator
      cmp - the comparator to compare elements
      Returns:
      the index of the first mismatch, or -1 if the iterators are identical or both are null or empty
      See Also:
    • lessThan

      public static <T extends Comparable<? super T>> boolean lessThan(T a, T b)
      Compares two comparable objects to determine if the first is less than the second. (null is considered as the smallest value in nature order).
      Type Parameters:
      T - the type of the objects being compared, which must be comparable
      Parameters:
      a - the first object to compare, must not be null
      b - the second object to compare, must not be null
      Returns:
      true if the first object is less than the second, false otherwise
    • lessThan

      public static <T> boolean lessThan(T a, T b, Comparator<? super T> cmp)
      Compares two objects using the specified comparator to determine if the first is less than the second.
      Type Parameters:
      T - the type of the objects being compared
      Parameters:
      a - the first object to compare, must not be null
      b - the second object to compare, must not be null
      cmp - the comparator to use for comparison, if null, the natural ordering of the objects will be used
      Returns:
      true if the first object is less than the second, false otherwise
    • lessEqual

      public static <T extends Comparable<? super T>> boolean lessEqual(T a, T b)
      Compares two comparable objects to determine if the first is less than or equal to the second. (null is considered as the smallest value in nature order).
      Type Parameters:
      T - the type of the objects being compared, which must be comparable
      Parameters:
      a - the first object to compare, must not be null
      b - the second object to compare, must not be null
      Returns:
      true if the first object is less than or equal to the second, false otherwise
    • lessEqual

      public static <T> boolean lessEqual(T a, T b, Comparator<? super T> cmp)
      Compares two objects using the specified comparator to determine if the first is less than or equal to the second.
      Type Parameters:
      T - the type of the objects being compared
      Parameters:
      a - the first object to compare, must not be null
      b - the second object to compare, must not be null
      cmp - the comparator to use for comparison, if null, the natural ordering of the objects will be used
      Returns:
      true if the first object is less than or equal to the second, false otherwise
    • greaterThan

      public static <T extends Comparable<? super T>> boolean greaterThan(T a, T b)
      Compares two comparable objects to determine if the first is greater than the second. (null is considered as the smallest value in nature order).
      Type Parameters:
      T - the type of the objects being compared, which must be comparable
      Parameters:
      a - the first object to compare, must not be null
      b - the second object to compare, must not be null
      Returns:
      true if the first object is greater than the second, false otherwise
    • greaterThan

      public static <T> boolean greaterThan(T a, T b, Comparator<? super T> cmp)
      Compares two objects using the specified comparator to determine if the first is greater than the second.
      Type Parameters:
      T - the type of the objects being compared
      Parameters:
      a - the first object to compare, must not be null
      b - the second object to compare, must not be null
      cmp - the comparator to use for comparison, if null, the natural ordering of the objects will be used
      Returns:
      true if the first object is greater than the second, false otherwise
    • greaterEqual

      public static <T extends Comparable<? super T>> boolean greaterEqual(T a, T b)
      Compares two comparable objects to determine if the first is greater than or equal to the second. (null is considered as the smallest value in nature order).
      Type Parameters:
      T - the type of the objects being compared, which must be comparable
      Parameters:
      a - the first object to compare, must not be null
      b - the second object to compare, must not be null
      Returns:
      true if the first object is greater than or equal to the second, false otherwise
    • greaterEqual

      public static <T> boolean greaterEqual(T a, T b, Comparator<? super T> cmp)
      Compares two objects using the specified comparator to determine if the first is greater than or equal to the second.
      Type Parameters:
      T - the type of the objects being compared
      Parameters:
      a - the first object to compare, must not be null
      b - the second object to compare, must not be null
      cmp - the comparator to use for comparison, if null, the natural ordering of the objects will be used
      Returns:
      true if the first object is greater than or equal to the second, false otherwise
    • gtAndLt

      public static <T extends Comparable<? super T>> boolean gtAndLt(T value, T min, T max)
      Checks if the given value is greater than the minimum value and less than the maximum value. (null is considered as the smallest value in nature order).
      Type Parameters:
      T - the type of the objects being compared, which must be comparable
      Parameters:
      value - the value to check, must not be null
      min - the minimum value, must not be null
      max - the maximum value, must not be null
      Returns:
      true if the value is greater than the minimum and less than the maximum, false otherwise
    • gtAndLt

      public static <T> boolean gtAndLt(T value, T min, T max, Comparator<? super T> cmp)
      Checks if the given value is greater than the minimum value and less than the maximum value using the specified comparator.
      Type Parameters:
      T - the type of the objects being compared
      Parameters:
      value - the value to check, must not be null
      min - the minimum value, must not be null
      max - the maximum value, must not be null
      cmp - the comparator to use for comparison, if null, the natural ordering of the objects will be used
      Returns:
      true if the value is greater than the minimum and less than the maximum, false otherwise
    • geAndLt

      public static <T extends Comparable<? super T>> boolean geAndLt(T value, T min, T max)
      Checks if the given value is greater than or equal to the minimum value and less than the maximum value. (null is considered as the smallest value in nature order).
      Type Parameters:
      T - the type of the objects being compared, which must be comparable
      Parameters:
      value - the value to check, must not be null
      min - the minimum value, must not be null
      max - the maximum value, must not be null
      Returns:
      true if the value is greater than or equal to the minimum and less than the maximum, false otherwise
    • geAndLt

      public static <T> boolean geAndLt(T value, T min, T max, Comparator<? super T> cmp)
      Checks if the given value is greater than or equal to the minimum value and less than the maximum value using the specified comparator.
      Type Parameters:
      T - the type of the objects being compared
      Parameters:
      value - the value to check, must not be null
      min - the minimum value, must not be null
      max - the maximum value, must not be null
      cmp - the comparator to use for comparison, if null, the natural ordering of the objects will be used
      Returns:
      true if the value is greater than or equal to the minimum and less than the maximum, false otherwise
    • geAndLe

      public static <T extends Comparable<? super T>> boolean geAndLe(T value, T min, T max)
      Checks if the given value is greater than or equal to the minimum value and less than or equal to the maximum value. (null is considered as the smallest value in nature order).
      Type Parameters:
      T - the type of the objects being compared, which must be comparable
      Parameters:
      value - the value to check, must not be null
      min - the minimum value, must not be null
      max - the maximum value, must not be null
      Returns:
      true if the value is greater than or equal to the minimum and less than or equal to the maximum, false otherwise
    • geAndLe

      public static <T> boolean geAndLe(T value, T min, T max, Comparator<? super T> cmp)
      Checks if the given value is greater than or equal to the minimum value and less than or equal to the maximum value using the specified comparator.
      Type Parameters:
      T - the type of the objects being compared
      Parameters:
      value - the value to check, must not be null
      min - the minimum value, must not be null
      max - the maximum value, must not be null
      cmp - the comparator to use for comparison, if null, the natural ordering of the objects will be used
      Returns:
      true if the value is greater than or equal to the minimum and less than or equal to the maximum, false otherwise
    • gtAndLe

      public static <T extends Comparable<? super T>> boolean gtAndLe(T value, T min, T max)
      Checks if the given value is greater than the minimum value and less than or equal to the maximum value. (null is considered as the smallest value in nature order).
      Type Parameters:
      T - the type of the objects being compared, which must be comparable
      Parameters:
      value - the value to check, must not be null
      min - the minimum value, must not be null
      max - the maximum value, must not be null
      Returns:
      true if the value is greater than the minimum and less than or equal to the maximum, false otherwise
    • gtAndLe

      public static <T> boolean gtAndLe(T value, T min, T max, Comparator<? super T> cmp)
      Checks if the given value is greater than the minimum value and less than or equal to the maximum value using the specified comparator.
      Type Parameters:
      T - the type of the objects being compared
      Parameters:
      value - the value to check, must not be null
      min - the minimum value, must not be null
      max - the maximum value, must not be null
      cmp - the comparator to use for comparison, if null, the natural ordering of the objects will be used
      Returns:
      true if the value is greater than the minimum and less than or equal to the maximum, false otherwise
    • isBetween

      @Deprecated public static <T extends Comparable<? super T>> boolean isBetween(T value, T min, T max)
      Deprecated.
      replaced by gtAndLt(Comparable, Comparable, Comparable)
      Checks if the given value is greater than the minimum value and less than the maximum value. (null is considered as the smallest value in nature order).
      Type Parameters:
      T - the type of the objects being compared, which must be comparable
      Parameters:
      value - the value to check, must not be null
      min - the minimum value, must not be null
      max - the maximum value, must not be null
      Returns:
      true if the value is greater than the minimum and less than the maximum, false otherwise
      See Also:
    • isBetween

      @Deprecated public static <T> boolean isBetween(T value, T min, T max, Comparator<? super T> cmp)
      Deprecated.
      replaced by gtAndLt(Comparable, Comparable, Comparable, Comparator)
      Checks if the given value is greater than the minimum value and less than the maximum value using the specified comparator.
      Type Parameters:
      T - the type of the objects being compared
      Parameters:
      value - the value to check, must not be null
      min - the minimum value, must not be null
      max - the maximum value, must not be null
      cmp - the comparator to use for comparison, if null, the natural ordering of the objects will be used
      Returns:
      true if the value is greater than the minimum and less than the maximum, false otherwise
      See Also:
      • invalid reference
        #gtAndLt(Comparable, Comparable, Comparable, Comparator)
    • equals

      public static boolean equals(boolean a, boolean b)
      Compares two boolean values for equality.
      Parameters:
      a - the first boolean value
      b - the second boolean value
      Returns:
      true if the boolean values are equal, false otherwise
    • equals

      public static boolean equals(char a, char b)
      Compares two char values for equality.
      Parameters:
      a - the first char value
      b - the second char value
      Returns:
      true if the char values are equal, false otherwise
    • equals

      public static boolean equals(byte a, byte b)
      Compares two byte values for equality.
      Parameters:
      a - the first byte value
      b - the second byte value
      Returns:
      true if the byte values are equal, false otherwise
    • equals

      public static boolean equals(short a, short b)
      Compares two short values for equality.
      Parameters:
      a - the first short value
      b - the second short value
      Returns:
      true if the short values are equal, false otherwise
    • equals

      public static boolean equals(int a, int b)
      Compares two int values for equality.
      Parameters:
      a - the first int value
      b - the second int value
      Returns:
      true if the int values are equal, false otherwise
    • equals

      public static boolean equals(long a, long b)
      Compares two long values for equality.
      Parameters:
      a - the first long value
      b - the second long value
      Returns:
      true if the long values are equal, false otherwise
    • equals

      public static boolean equals(float a, float b)
      Compares two float values for equality.
      Parameters:
      a - the first float value
      b - the second float value
      Returns:
      true if the float values are equal, false otherwise
    • equals

      public static boolean equals(double a, double b)
      Compares two double values for equality.
      Parameters:
      a - the first double value
      b - the second double value
      Returns:
      true if the double values are equal, false otherwise
    • equals

      public static boolean equals(String a, String b)
      Compares two strings for equality.
      Parameters:
      a - the first string
      b - the second string
      Returns:
      true if the strings are equal, false otherwise
    • equalsIgnoreCase

      public static boolean equalsIgnoreCase(String a, String b)
      Compares two strings for equality, ignoring case.
      Parameters:
      a - the first string
      b - the second string
      Returns:
      true if the strings are equal, false otherwise
    • equals

      public static boolean equals(Object a, Object b)
      Compares two objects for equality. If the objects are arrays, the appropriate Arrays.equals method will be used.
      Parameters:
      a - the first object
      b - the second object
      Returns:
      true if the objects are equal, false otherwise
    • equals

      public static boolean equals(boolean[] a, boolean[] b)
      Compares two arrays for equality.
      Parameters:
      a - the first array
      b - the second array
      Returns:
      true if the arrays are equal, false otherwise
      See Also:
    • equals

      public static boolean equals(boolean[] a, int fromIndexA, boolean[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two boolean arrays for equality within the specified range.
      Parameters:
      a - the first boolean array, must not be null
      fromIndexA - the starting index in the first array, inclusive
      b - the second boolean array, must not be null
      fromIndexB - the starting index in the second array, inclusive
      len - the number of elements to compare
      Returns:
      true if the specified range of elements in both arrays are equal, false otherwise
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified range is out of bounds
      See Also:
    • equals

      public static boolean equals(char[] a, char[] b)
      Compares two arrays for equality.
      Parameters:
      a - the first array
      b - the second array
      Returns:
      true if the arrays are equal, false otherwise
      See Also:
    • equals

      public static boolean equals(char[] a, int fromIndexA, char[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two char arrays for equality within the specified range.
      Parameters:
      a - the first char array, must not be null
      fromIndexA - the starting index in the first array, inclusive
      b - the second char array, must not be null
      fromIndexB - the starting index in the second array, inclusive
      len - the number of elements to compare
      Returns:
      true if the specified range of elements in both arrays are equal, false otherwise
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified range is out of bounds
      See Also:
    • equals

      public static boolean equals(byte[] a, byte[] b)
      Compares two arrays for equality.
      Parameters:
      a - the first array
      b - the second array
      Returns:
      true if the arrays are equal, false otherwise
      See Also:
    • equals

      public static boolean equals(byte[] a, int fromIndexA, byte[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two byte arrays for equality within the specified range.
      Parameters:
      a - the first byte array, must not be null
      fromIndexA - the starting index in the first array, inclusive
      b - the second byte array, must not be null
      fromIndexB - the starting index in the second array, inclusive
      len - the number of elements to compare
      Returns:
      true if the specified range of elements in both arrays are equal, false otherwise
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified range is out of bounds
      See Also:
    • equals

      public static boolean equals(short[] a, short[] b)
      Compares two arrays for equality.
      Parameters:
      a - the first array
      b - the second array
      Returns:
      true if the arrays are equal, false otherwise
      See Also:
    • equals

      public static boolean equals(short[] a, int fromIndexA, short[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two short arrays for equality within the specified range.
      Parameters:
      a - the first short array, must not be null
      fromIndexA - the starting index in the first array, inclusive
      b - the second short array, must not be null
      fromIndexB - the starting index in the second array, inclusive
      len - the number of elements to compare
      Returns:
      true if the specified range of elements in both arrays are equal, false otherwise
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified range is out of bounds
      See Also:
    • equals

      public static boolean equals(int[] a, int[] b)
      Compares two arrays for equality.
      Parameters:
      a - the first array
      b - the second array
      Returns:
      true if the arrays are equal, false otherwise
      See Also:
    • equals

      public static boolean equals(int[] a, int fromIndexA, int[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two int arrays for equality within the specified range.
      Parameters:
      a - the first int array, must not be null
      fromIndexA - the starting index in the first array, inclusive
      b - the second int array, must not be null
      fromIndexB - the starting index in the second array, inclusive
      len - the number of elements to compare
      Returns:
      true if the specified range of elements in both arrays are equal, false otherwise
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified range is out of bounds
      See Also:
    • equals

      public static boolean equals(long[] a, long[] b)
      Compares two arrays for equality.
      Parameters:
      a - the first array
      b - the second array
      Returns:
      true if the arrays are equal, false otherwise
      See Also:
    • equals

      public static boolean equals(long[] a, int fromIndexA, long[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two long arrays for equality within the specified range.
      Parameters:
      a - the first long array, must not be null
      fromIndexA - the starting index in the first array, inclusive
      b - the second long array, must not be null
      fromIndexB - the starting index in the second array, inclusive
      len - the number of elements to compare
      Returns:
      true if the specified range of elements in both arrays are equal, false otherwise
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified range is out of bounds
      See Also:
    • equals

      public static boolean equals(float[] a, float[] b)
      Compares two arrays for equality.
      Parameters:
      a - the first array
      b - the second array
      Returns:
      true if the arrays are equal, false otherwise
      See Also:
    • equals

      public static boolean equals(float[] a, int fromIndexA, float[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two float arrays for equality within the specified range.
      Parameters:
      a - the first float array, must not be null
      fromIndexA - the starting index in the first array, inclusive
      b - the second float array, must not be null
      fromIndexB - the starting index in the second array, inclusive
      len - the number of elements to compare
      Returns:
      true if the specified range of elements in both arrays are equal, false otherwise
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified range is out of bounds
      See Also:
    • equals

      public static boolean equals(double[] a, double[] b)
      Compares two arrays for equality.
      Parameters:
      a - the first array
      b - the second array
      Returns:
      true if the arrays are equal, false otherwise
      See Also:
    • equals

      public static boolean equals(double[] a, int fromIndexA, double[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two double arrays for equality within the specified range.
      Parameters:
      a - the first double array, must not be null
      fromIndexA - the starting index in the first array, inclusive
      b - the second double array, must not be null
      fromIndexB - the starting index in the second array, inclusive
      len - the number of elements to compare
      Returns:
      true if the specified range of elements in both arrays are equal, false otherwise
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified range is out of bounds
      See Also:
    • equals

      public static boolean equals(Object[] a, Object[] b)
      Compares two arrays for equality.
      Parameters:
      a - the first array
      b - the second array
      Returns:
      true if the arrays are equal, false otherwise
      See Also:
    • equals

      public static boolean equals(Object[] a, int fromIndexA, Object[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two arrays for equality within the specified range.
      Parameters:
      a - the first array, must not be null
      fromIndexA - the starting index in the first array, inclusive
      b - the second array, must not be null
      fromIndexB - the starting index in the second array, inclusive
      len - the number of elements to compare
      Returns:
      true if the specified range of elements in both arrays are equal, false otherwise
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified range is out of bounds
      See Also:
    • deepEquals

      public static boolean deepEquals(Object a, Object b)
      Compares two objects for equality. If the objects are arrays, the appropriate Arrays.deepEquals method will be used.
      Parameters:
      a - the first object to compare, may be null
      b - the second object to compare, may be null
      Returns:
      true if the objects are deeply equal, false otherwise
      See Also:
    • deepEquals

      public static boolean deepEquals(Object[] a, Object[] b)
      Compares two arrays for deep equality.
      Parameters:
      a - the first array
      b - the second array
      Returns:
      true if the arrays are equal, false otherwise
      See Also:
    • deepEquals

      public static boolean deepEquals(Object[] a, int fromIndexA, Object[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two arrays for deep equality within the specified range.
      Parameters:
      a - the first array, must not be null
      fromIndexA - the starting index in the first array, inclusive
      b - the second array, must not be null
      fromIndexB - the starting index in the second array, inclusive
      len - the number of elements to compare
      Returns:
      true if the specified range of elements in both arrays are equal, false otherwise
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified range is out of bounds
      See Also:
    • equalsIgnoreCase

      public static boolean equalsIgnoreCase(String[] a, String[] b)
      Compares two arrays of Strings, ignoring case considerations.
      Parameters:
      a - the first array of Strings to compare, may be null
      b - the second array of Strings to compare, may be null
      Returns:
      true if the arrays are equal, ignoring case considerations, or both are null; false otherwise
    • equalsIgnoreCase

      public static boolean equalsIgnoreCase(String[] a, int fromIndexA, String[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two arrays of Strings, ignoring case considerations, within the specified range.
      Parameters:
      a - the first array of Strings to compare, may be null
      fromIndexA - the starting index in the first array, inclusive
      b - the second array of Strings to compare, may be null
      fromIndexB - the starting index in the second array, inclusive
      len - the number of elements to compare
      Returns:
      true if the specified range of elements in both arrays are equal, ignoring case considerations, or both are null; false otherwise
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified range is out of bounds
    • equalsByProps

      public static boolean equalsByProps(Object bean1, Object bean2, Collection<String> propNamesToCompare) throws IllegalArgumentException
      Compares the specified properties of two beans to determine if they are equal.
      Parameters:
      bean1 - the first bean to compare, must not be null
      bean2 - the second bean to compare, must not be null
      propNamesToCompare - the collection of property names to compare, must not be null
      Returns:
      true if the properties of the beans are equal, false otherwise
      Throws:
      IllegalArgumentException - if any of the arguments are null
    • equalsByCommonProps

      public static boolean equalsByCommonProps(@NotNull Object bean1, @NotNull Object bean2) throws IllegalArgumentException
      Compares the properties of two beans to determine if they are equal.
      Parameters:
      bean1 - the first bean to compare, must not be null
      bean2 - the second bean to compare, must not be null
      propNamesToCompare - the array of property names to compare, must not be null
      Returns:
      true if all the properties of the beans are equal, false otherwise
      Throws:
      IllegalArgumentException - if any of the arguments are null
    • hashCode

      public static int hashCode(boolean value)
      Returns the hash code for a boolean value.
      Parameters:
      value - the boolean value
      Returns:
      the hash code.
    • hashCode

      public static int hashCode(char value)
      Returns the hash code for a char value.
      Parameters:
      value - the char value
      Returns:
      the hash code
    • hashCode

      public static int hashCode(byte value)
      Returns the hash code for a byte value.
      Parameters:
      value - the byte value
      Returns:
      the hash code
    • hashCode

      public static int hashCode(short value)
      Returns the hash code for a short value.
      Parameters:
      value - the short value
      Returns:
      the hash code
    • hashCode

      public static int hashCode(int value)
      Returns the hash code for an int value.
      Parameters:
      value - the int value
      Returns:
      the hash code
    • hashCode

      public static int hashCode(long value)
      Returns the hash code for a long value.
      Parameters:
      value - the long value
      Returns:
      the hash code
    • hashCode

      public static int hashCode(float value)
      Returns the hash code for a float value.
      Parameters:
      value - the float value
      Returns:
      the hash code
    • hashCode

      public static int hashCode(double value)
      Returns the hash code for a double value.
      Parameters:
      value - the double value
      Returns:
      the hash code
    • hashCode

      public static int hashCode(Object obj)
      Returns the hash code for an object. If the object is an array, the appropriate Arrays.hashCode method will be used
      Parameters:
      obj - the object for which the hash code is to be calculated
      Returns:
      the hash code of the object, or 0 if the object is null
    • hashCode

      public static int hashCode(boolean[] a)
      Returns the hash code for an array of booleans.
      Parameters:
      a - the array of booleans
      Returns:
      the hash code of the array
      See Also:
    • hashCode

      public static int hashCode(boolean[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns the hash code for a range of elements in a boolean array.
      Parameters:
      a - the array of booleans
      fromIndex - the starting index (inclusive)
      toIndex - the ending index (exclusive)
      Returns:
      the hash code for the specified range of the array
      Throws:
      IndexOutOfBoundsException - if the indices are out of range
    • hashCode

      public static int hashCode(char[] a)
      Returns the hash code for an array of chars.
      Parameters:
      a - the array of chars
      Returns:
      the hash code of the array
      See Also:
    • hashCode

      public static int hashCode(char[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns the hash code for a range of elements in a char array.
      Parameters:
      a - the array of chars
      fromIndex - the starting index (inclusive)
      toIndex - the ending index (exclusive)
      Returns:
      the hash code for the specified range of the array
      Throws:
      IndexOutOfBoundsException - if the indices are out of range
    • hashCode

      public static int hashCode(byte[] a)
      Returns the hash code for an array of bytes.
      Parameters:
      a - the array of bytes
      Returns:
      the hash code of the array
      See Also:
    • hashCode

      public static int hashCode(byte[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns the hash code for a range of elements in a byte array.
      Parameters:
      a - the array of bytes
      fromIndex - the starting index (inclusive)
      toIndex - the ending index (exclusive)
      Returns:
      the hash code for the specified range of the array
      Throws:
      IndexOutOfBoundsException - if the indices are out of range
    • hashCode

      public static int hashCode(short[] a)
      Returns the hash code for an array of shorts.
      Parameters:
      a - the array of shorts
      Returns:
      the hash code of the array
      See Also:
    • hashCode

      public static int hashCode(short[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns the hash code for a range of elements in a short array.
      Parameters:
      a - the array of shorts
      fromIndex - the starting index (inclusive)
      toIndex - the ending index (exclusive)
      Returns:
      the hash code for the specified range of the array
      Throws:
      IndexOutOfBoundsException - if the indices are out of range
    • hashCode

      public static int hashCode(int[] a)
      Returns the hash code for an array of ints.
      Parameters:
      a - the array of ints
      Returns:
      the hash code of the array
      See Also:
    • hashCode

      public static int hashCode(int[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns the hash code for a range of elements in an int array.
      Parameters:
      a - the array of ints
      fromIndex - the starting index (inclusive)
      toIndex - the ending index (exclusive)
      Returns:
      the hash code for the specified range of the array
      Throws:
      IndexOutOfBoundsException - if the indices are out of range
    • hashCode

      public static int hashCode(long[] a)
      Returns the hash code for an array of longs.
      Parameters:
      a - the array of longs
      Returns:
      the hash code of the array
      See Also:
    • hashCode

      public static int hashCode(long[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns the hash code for a range of elements in a long array.
      Parameters:
      a - the array of longs
      fromIndex - the starting index (inclusive)
      toIndex - the ending index (exclusive)
      Returns:
      the hash code for the specified range of the array
      Throws:
      IndexOutOfBoundsException - if the indices are out of range
    • hashCode

      public static int hashCode(float[] a)
      Returns the hash code for an array of floats.
      Parameters:
      a - the array of floats
      Returns:
      the hash code of the array
      See Also:
    • hashCode

      public static int hashCode(float[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns the hash code for a range of elements in a float array.
      Parameters:
      a - the array of floats
      fromIndex - the starting index (inclusive)
      toIndex - the ending index (exclusive)
      Returns:
      the hash code for the specified range of the array
      Throws:
      IndexOutOfBoundsException - if the indices are out of range
    • hashCode

      public static int hashCode(double[] a)
      Returns the hash code for an array of doubles.
      Parameters:
      a - the array of doubles
      Returns:
      the hash code of the array
      See Also:
    • hashCode

      public static int hashCode(double[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns the hash code for a range of elements in a double array.
      Parameters:
      a - the array of doubles
      fromIndex - the starting index (inclusive)
      toIndex - the ending index (exclusive)
      Returns:
      the hash code for the specified range of the array
      Throws:
      IndexOutOfBoundsException - if the indices are out of range
    • hashCode

      public static int hashCode(Object[] a)
      Returns the hash code for an array of Objects.
      Parameters:
      a - the array of Objects
      Returns:
      the hash code of the array
      See Also:
    • hashCode

      public static int hashCode(Object[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns the hash code for a range of elements in an Object array.
      Parameters:
      a - the array of Objects
      fromIndex - the starting index (inclusive)
      toIndex - the ending index (exclusive)
      Returns:
      the hash code for the specified range of the array
      Throws:
      IndexOutOfBoundsException - if the indices are out of range
    • deepHashCode

      public static int deepHashCode(Object obj)
      Returns the hash code for the specified object. If the object is an array, the appropriate Arrays.deepHashCode method will be used.
      Parameters:
      obj - the object for which the hash code is to be calculated
      Returns:
      the hash code of the object, or 0 if the object is null
      See Also:
    • deepHashCode

      public static int deepHashCode(Object[] a)
      Returns the hash code for an array of Objects.
      Parameters:
      a - the array of Objects
      Returns:
      the hash code of the array
      See Also:
    • deepHashCode

      public static int deepHashCode(Object[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns the hash code for a range of elements in an Object array.
      Parameters:
      a - the array of Objects
      fromIndex - the starting index (inclusive)
      toIndex - the ending index (exclusive)
      Returns:
      the hash code for the specified range of the array
      Throws:
      IndexOutOfBoundsException - if the indices are out of range
      See Also:
    • toString

      public static String toString(boolean value)
      Returns a string representation of the specified boolean value.
      Parameters:
      value - the boolean value to be represented as a string
      Returns:
      the String representation of the boolean value
    • toString

      public static String toString(char value)
      Returns a string representation of the specified char value.
      Parameters:
      value - the char value to be represented as a string
      Returns:
      the String representation of the char value
    • toString

      public static String toString(byte value)
      Returns a string representation of the specified byte value.
      Parameters:
      value - the byte value to be represented as a string
      Returns:
      the String representation of the byte value
    • toString

      public static String toString(short value)
      Returns a string representation of the specified short value.
      Parameters:
      value - the short value to be represented as a string
      Returns:
      the String representation of the short value
    • toString

      public static String toString(int value)
      Returns a string representation of the specified int value.
      Parameters:
      value - the int value to be represented as a string
      Returns:
      the String representation of the int value
    • toString

      public static String toString(long value)
      Returns a string representation of the specified long value.
      Parameters:
      value - the long value to be represented as a string
      Returns:
      the String representation of the long value
    • toString

      public static String toString(float value)
      Returns a string representation of the specified float value.
      Parameters:
      value - the float value to be represented as a string
      Returns:
      the String representation of the float value
    • toString

      public static String toString(double value)
      Returns a string representation of the specified double value.
      Parameters:
      value - the double value to be represented as a string
      Returns:
      the String representation of the double value
    • toString

      public static String toString(Object obj)
      Returns a string representation of the specified object.
      Parameters:
      obj - the object to be represented as a string
      Returns:
      the String representation of the object. If the object is null, the string "null" is returned.
    • toString

      public static String toString(Object a, String defaultIfNull)
      Returns a string representation of the specified object. If the object is null, the specified default value is returned.
      Parameters:
      defaultIfNull - the default value to be returned if the object is null
      obj - the object to be represented as a string
      Returns:
      the String representation of the object, or the default value if the object is null
    • toString

      public static String toString(boolean[] a)
      Returns a string representation of the specified boolean array.
      Parameters:
      a - the boolean array to be represented as a string
      Returns:
      the String representation of the boolean array
      See Also:
    • toString

      public static String toString(boolean[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a string representation of the specified range of elements in a boolean array.
      Parameters:
      a - the boolean array to be represented as a string
      fromIndex - the starting index (inclusive)
      toIndex - the ending index (exclusive)
      Returns:
      the String representation of the specified range of the boolean array
      Throws:
      IndexOutOfBoundsException - if the indices are out of range
    • toString

      public static String toString(char[] a)
      Returns a string representation of the specified char array.
      Parameters:
      a - the char array to be represented as a string
      Returns:
      the String representation of the char array
      See Also:
    • toString

      public static String toString(char[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a string representation of the specified range of elements in a char array.
      Parameters:
      a - the char array to be represented as a string
      fromIndex - the starting index (inclusive)
      toIndex - the ending index (exclusive)
      Returns:
      the String representation of the specified range of the char array
      Throws:
      IndexOutOfBoundsException - if the indices are out of range
    • toString

      public static String toString(byte[] a)
      Returns a string representation of the specified byte array.
      Parameters:
      a - the byte array to be represented as a string
      Returns:
      the String representation of the byte array
      See Also:
    • toString

      public static String toString(byte[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a string representation of the specified range of elements in a byte array.
      Parameters:
      a - the byte array to be represented as a string
      fromIndex - the starting index (inclusive)
      toIndex - the ending index (exclusive)
      Returns:
      the String representation of the specified range of the byte array
      Throws:
      IndexOutOfBoundsException - if the indices are out of range
    • toString

      public static String toString(short[] a)
      Returns a string representation of the specified short array.
      Parameters:
      a - the short array to be represented as a string
      Returns:
      the String representation of the short array
      See Also:
    • toString

      public static String toString(short[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a string representation of the specified range of elements in a short array.
      Parameters:
      a - the short array to be represented as a string
      fromIndex - the starting index (inclusive)
      toIndex - the ending index (exclusive)
      Returns:
      the String representation of the specified range of the short array
      Throws:
      IndexOutOfBoundsException - if the indices are out of range
    • toString

      public static String toString(int[] a)
      Returns a string representation of the specified int array.
      Parameters:
      a - the int array to be represented as a string
      Returns:
      the String representation of the int array
      See Also:
    • toString

      public static String toString(int[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a string representation of the specified range of elements in an int array.
      Parameters:
      a - the int array to be represented as a string
      fromIndex - the starting index (inclusive)
      toIndex - the ending index (exclusive)
      Returns:
      the String representation of the specified range of the int array
      Throws:
      IndexOutOfBoundsException - if the indices are out of range
    • toString

      public static String toString(long[] a)
      Returns a string representation of the specified long array.
      Parameters:
      a - the long array to be represented as a string
      Returns:
      the String representation of the long array
      See Also:
    • toString

      public static String toString(long[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a string representation of the specified range of elements in a long array.
      Parameters:
      a - the long array to be represented as a string
      fromIndex - the starting index (inclusive)
      toIndex - the ending index (exclusive)
      Returns:
      the String representation of the specified range of the long array
      Throws:
      IndexOutOfBoundsException - if the indices are out of range
    • toString

      public static String toString(float[] a)
      Returns a string representation of the specified float array.
      Parameters:
      a - the float array to be represented as a string
      Returns:
      the String representation of the float array
      See Also:
    • toString

      public static String toString(float[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a string representation of the specified range of elements in a float array.
      Parameters:
      a - the float array to be represented as a string
      fromIndex - the starting index (inclusive)
      toIndex - the ending index (exclusive)
      Returns:
      the String representation of the specified range of the float array
      Throws:
      IndexOutOfBoundsException - if the indices are out of range
    • toString

      public static String toString(double[] a)
      Returns a string representation of the specified double array.
      Parameters:
      a - the double array to be represented as a string
      Returns:
      the String representation of the double array
      See Also:
    • toString

      public static String toString(double[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a string representation of the specified range of elements in a double array.
      Parameters:
      a - the double array to be represented as a string
      fromIndex - the starting index (inclusive)
      toIndex - the ending index (exclusive)
      Returns:
      the String representation of the specified range of the double array
      Throws:
      IndexOutOfBoundsException - if the indices are out of range
    • toString

      public static String toString(Object[] a)
      Returns a string representation of the specified Object array.
      Parameters:
      a - the Object array to be represented as a string
      Returns:
      the String representation of the Object array
      See Also:
    • toString

      public static String toString(Object[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a string representation of the specified range of elements in an Object array.
      Parameters:
      a - the Object array to be represented as a string
      fromIndex - the starting index (inclusive)
      toIndex - the ending index (exclusive)
      Returns:
      the String representation of the specified range of the Object array
      Throws:
      IndexOutOfBoundsException - if the indices are out of range
    • deepToString

      public static String deepToString(Object obj)
      Returns a string representation of the "deep contents" of the specified object. If the object is an array, the appropriate Arrays.toString(array) method will be used. This method recursively converts the object and its nested objects to a string.
      Parameters:
      obj - the object to be represented as a string
      Returns:
      the string representation of the object
    • deepToString

      public static String deepToString(Object[] a)
      Returns a string representation of the "deep contents" of the specified array. If the object is null, the specified default value is returned.
      Parameters:
      obj - the object to be represented as a string
      defaultIfNull - the default value to be returned if the object is null
      Returns:
      the String representation of the object, or the default value if the object is null
      See Also:
    • deepToString

      public static String deepToString(Object[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a string representation of the "deep contents" of the specified range of elements in an Object array. This method recursively converts the object and its nested objects to a string.
      Parameters:
      a - the Object array to be represented as a string
      fromIndex - the starting index (inclusive)
      toIndex - the ending index (exclusive)
      Returns:
      the String representation of the specified range of the Object array
      Throws:
      IndexOutOfBoundsException - if the indices are out of range
      See Also:
    • deepToString

      public static String deepToString(Object[] a, String defaultIfNull)
      Returns a string representation of the "deep contents" of the specified array. If the object is null, the specified default value is returned.
      Parameters:
      a - the Object array to be represented as a string
      defaultIfNull - the default value to be returned if the object is null
      Returns:
      the String representation of the object, or the default value if the object is null
      See Also:
    • reverse

      public static void reverse(boolean[] a)
      Reverses the order of the elements in the specified boolean array. The reversing is performed in-place, meaning the original array is modified.
      Parameters:
      a - the boolean array to be reversed
    • reverse

      public static void reverse(boolean[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Reverses the order of the elements in the specified range of the specified boolean array. The reversing is performed in-place, meaning the original array is modified.
      Parameters:
      a - the boolean array to be reversed
      fromIndex - the starting index (inclusive)
      toIndex - the ending index (exclusive)
      Throws:
      IndexOutOfBoundsException - if the indices are out of range
    • reverse

      public static void reverse(char[] a)
      Reverses the order of the elements in the specified char array. The reversing is performed in-place, meaning the original array is modified.
      Parameters:
      a - the char array to be reversed
    • reverse

      public static void reverse(char[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Reverses the order of the elements in the specified range of the specified char array. The reversing is performed in-place, meaning the original array is modified.
      Parameters:
      a - the char array to be reversed
      fromIndex - the starting index (inclusive)
      toIndex - the ending index (exclusive)
      Throws:
      IndexOutOfBoundsException - if the indices are out of range
    • reverse

      public static void reverse(byte[] a)
      Reverses the order of the elements in the specified byte array. The reversing is performed in-place, meaning the original array is modified.
      Parameters:
      a - the byte array to be reversed
    • reverse

      public static void reverse(byte[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Reverses the order of the elements in the specified range of the specified byte array. The reversing is performed in-place, meaning the original array is modified.
      Parameters:
      a - the byte array to be reversed
      fromIndex - the starting index (inclusive)
      toIndex - the ending index (exclusive)
      Throws:
      IndexOutOfBoundsException - if the indices are out of range
    • reverse

      public static void reverse(short[] a)
      Reverses the order of the elements in the specified short array. The reversing is performed in-place, meaning the original array is modified.
      Parameters:
      a - the short array to be reversed
    • reverse

      public static void reverse(short[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Reverses the order of the elements in the specified range of the specified short array. The reversing is performed in-place, meaning the original array is modified.
      Parameters:
      a - the short array to be reversed
      fromIndex - the starting index (inclusive)
      toIndex - the ending index (exclusive)
      Throws:
      IndexOutOfBoundsException - if the indices are out of range
    • reverse

      public static void reverse(int[] a)
      Reverses the order of the elements in the specified int array. The reversing is performed in-place, meaning the original array is modified.
      Parameters:
      a - the int array to be reversed
    • reverse

      public static void reverse(int[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Reverses the order of the elements in the specified range of the specified int array. The reversing is performed in-place, meaning the original array is modified.
      Parameters:
      a - the int array to be reversed
      fromIndex - the starting index (inclusive)
      toIndex - the ending index (exclusive)
      Throws:
      IndexOutOfBoundsException - if the indices are out of range
    • reverse

      public static void reverse(long[] a)
      Reverses the order of the elements in the specified long array. The reversing is performed in-place, meaning the original array is modified.
      Parameters:
      a - the long array to be reversed
    • reverse

      public static void reverse(long[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Reverses the order of the elements in the specified range of the specified long array. The reversing is performed in-place, meaning the original array is modified.
      Parameters:
      a - the long array to be reversed
      fromIndex - the starting index (inclusive)
      toIndex - the ending index (exclusive)
      Throws:
      IndexOutOfBoundsException - if the indices are out of range
    • reverse

      public static void reverse(float[] a)
      Reverses the order of the elements in the specified float array. The reversing is performed in-place, meaning the original array is modified.
      Parameters:
      a - the float array to be reversed
    • reverse

      public static void reverse(float[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Reverses the order of the elements in the specified range of the specified float array. The reversing is performed in-place, meaning the original array is modified.
      Parameters:
      a - the float array to be reversed
      fromIndex - the starting index (inclusive)
      toIndex - the ending index (exclusive)
      Throws:
      IndexOutOfBoundsException - if the indices are out of range
    • reverse

      public static void reverse(double[] a)
      Reverses the order of the elements in the specified double array. The reversing is performed in-place, meaning the original array is modified.
      Parameters:
      a - the double array to be reversed
    • reverse

      public static void reverse(double[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Reverses the order of the elements in the specified range of the specified double array. The reversing is performed in-place, meaning the original array is modified.
      Parameters:
      a - the double array to be reversed
      fromIndex - the starting index (inclusive)
      toIndex - the ending index (exclusive)
      Throws:
      IndexOutOfBoundsException - if the indices are out of range
    • reverse

      public static void reverse(Object[] a)
      Reverses the order of the elements in the specified object array. The reversing is performed in-place, meaning the original array is modified.
      Parameters:
      a - the object array to be reversed
    • reverse

      public static void reverse(Object[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Reverses the order of the elements in the specified range of the specified object array. The reversing is performed in-place, meaning the original array is modified.
      Parameters:
      a - the object array to be reversed
      fromIndex - the starting index (inclusive)
      toIndex - the ending index (exclusive)
      Throws:
      IndexOutOfBoundsException - if the indices are out of range
    • reverse

      public static void reverse(List<?> list)
      Reverses the order of the elements in the specified list. The reversing is performed in-place, meaning the original list is modified.
      Parameters:
      list - the list to be reversed
      See Also:
    • reverse

      public static void reverse(List<?> list, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Reverses the order of the elements in the specified range of the specified list. The reversing is performed in-place, meaning the original list is modified.
      Parameters:
      list - the list to be reversed
      fromIndex - the starting index (inclusive)
      toIndex - the ending index (exclusive)
      Throws:
      IndexOutOfBoundsException - if the indices are out of range
      See Also:
    • reverse

      @Beta public static void reverse(Collection<?> c)
      Reverses the order of the elements in the specified collection that has a well-defined encounter order. The reversing is performed in-place, meaning the original collection is modified.
      Parameters:
      c - the collection to be reversed. It should be a collection that has a well-defined encounter order.
      See Also:
    • reverseToList

      @Beta public static <T> List<T> reverseToList(Collection<? extends T> c)
      Returns a new list with the elements from the specified collection in reverse order. The specified collection doesn't need to have a well-defined encounter order and won't be modified.
      Type Parameters:
      T - the type of elements in the collection
      Parameters:
      c - the collection whose elements will be added to the returned list in reverse order.
      Returns:
      a new list with the elements from the specified collection in reverse order.
      See Also:
    • rotate

      public static void rotate(boolean[] a, int distance)
      Rotates the elements of the specified boolean array by the specified distance. The rotation is performed in-place, meaning the original array is modified.
      Parameters:
      a - the boolean array to be rotated
      distance - the distance to rotate the array. Positive values rotate the array to the right, and negative values rotate the array to the left.
    • rotate

      public static void rotate(char[] a, int distance)
      Rotates the elements of the specified char array by the specified distance. The rotation is performed in-place, meaning the original array is modified.
      Parameters:
      a - the char array to be rotated
      distance - the distance to rotate the array. Positive values rotate the array to the right, and negative values rotate the array to the left.
    • rotate

      public static void rotate(byte[] a, int distance)
      Rotates the elements of the specified byte array by the specified distance. The rotation is performed in-place, meaning the original array is modified.
      Parameters:
      a - the byte array to be rotated
      distance - the distance to rotate the array. Positive values rotate the array to the right, and negative values rotate the array to the left.
    • rotate

      public static void rotate(short[] a, int distance)
      Rotates the elements of the specified short array by the specified distance. The rotation is performed in-place, meaning the original array is modified.
      Parameters:
      a - the short array to be rotated
      distance - the distance to rotate the array. Positive values rotate the array to the right, and negative values rotate the array to the left.
    • rotate

      public static void rotate(int[] a, int distance)
      Rotates the elements of the specified int array by the specified distance. The rotation is performed in-place, meaning the original array is modified.
      Parameters:
      a - the int array to be rotated
      distance - the distance to rotate the array. Positive values rotate the array to the right, and negative values rotate the array to the left.
    • rotate

      public static void rotate(long[] a, int distance)
      Rotates the elements of the specified long array by the specified distance. The rotation is performed in-place, meaning the original array is modified.
      Parameters:
      a - the long array to be rotated
      distance - the distance to rotate the array. Positive values rotate the array to the right, and negative values rotate the array to the left.
    • rotate

      public static void rotate(float[] a, int distance)
      Rotates the elements of the specified float array by the specified distance. The rotation is performed in-place, meaning the original array is modified.
      Parameters:
      a - the float array to be rotated
      distance - the distance to rotate the array. Positive values rotate the array to the right, and negative values rotate the array to the left.
    • rotate

      public static void rotate(double[] a, int distance)
      Rotates the elements of the specified double array by the specified distance. The rotation is performed in-place, meaning the original array is modified.
      Parameters:
      a - the double array to be rotated
      distance - the distance to rotate the array. Positive values rotate the array to the right, and negative values rotate the array to the left.
    • rotate

      public static void rotate(Object[] a, int distance)
      Rotates the elements of the specified Object array by the specified distance. The rotation is performed in-place, meaning the original array is modified.
      Parameters:
      a - the Object array to be rotated
      distance - the distance to rotate the array. Positive values rotate the array to the right, and negative values rotate the array to the left.
    • rotate

      public static void rotate(List<?> list, int distance)
      Rotates the elements of the specified list by the specified distance. The rotation is performed in-place, meaning the original list is modified.
      Parameters:
      list - the list to be rotated
      distance - the distance to rotate the array. Positive values rotate the array to the right, and negative values rotate the array to the left.
      See Also:
    • rotate

      @Beta public static void rotate(Collection<?> c, int distance)
      Rotates the elements of the specified collection that has a well-defined encounter order by the specified distance. The rotation is performed in-place, meaning the original collection is modified.
      Parameters:
      c - the collection to be rotated. It should be a collection that has a well-defined encounter order.
      distance - the distance to rotate the array. Positive values rotate the array to the right, and negative values rotate the array to the left.
      See Also:
    • shuffle

      public static void shuffle(boolean[] a)
      Shuffles the elements of the specified boolean array. The shuffling is performed in-place, meaning the original array is modified.
      Parameters:
      a - the boolean array to be shuffled
    • shuffle

      public static void shuffle(boolean[] a, Random rnd)
      Shuffles the elements of the specified boolean array using the specified random number generator. The shuffling is performed in-place, meaning the original array is modified.
      Parameters:
      a - the boolean array to be shuffled
      rnd - the random number generator to use
    • shuffle

      public static void shuffle(char[] a)
      Shuffles the elements of the specified char array. The shuffling is performed in-place, meaning the original array is modified.
      Parameters:
      a - the char array to be shuffled
    • shuffle

      public static void shuffle(char[] a, Random rnd)
      Shuffles the elements of the specified char array using the specified random number generator. The shuffling is performed in-place, meaning the original array is modified.
      Parameters:
      a - the char array to be shuffled
      rnd - the random number generator to use
    • shuffle

      public static void shuffle(byte[] a)
      Shuffles the elements of the specified byte array. The shuffling is performed in-place, meaning the original array is modified.
      Parameters:
      a - the byte array to be shuffled
    • shuffle

      public static void shuffle(byte[] a, Random rnd)
      Shuffles the elements of the specified byte array using the specified random number generator. The shuffling is performed in-place, meaning the original array is modified.
      Parameters:
      a - the byte array to be shuffled
      rnd - the random number generator to use
    • shuffle

      public static void shuffle(short[] a)
      Shuffles the elements of the specified short array. The shuffling is performed in-place, meaning the original array is modified.
      Parameters:
      a - the short array to be shuffled
    • shuffle

      public static void shuffle(short[] a, Random rnd)
      Shuffles the elements of the specified short array using the specified random number generator. The shuffling is performed in-place, meaning the original array is modified.
      Parameters:
      a - the short array to be shuffled
      rnd - the random number generator
    • shuffle

      public static void shuffle(int[] a)
      Shuffles the elements of the specified int array. The shuffling is performed in-place, meaning the original array is modified.
      Parameters:
      a - the int array to be shuffled
    • shuffle

      public static void shuffle(int[] a, Random rnd)
      Shuffles the elements of the specified int array using the specified random number generator. The shuffling is performed in-place, meaning the original array is modified.
      Parameters:
      a - the int array to be shuffled
      rnd - the random number generator to use
    • shuffle

      public static void shuffle(long[] a)
      Shuffles the elements of the specified long array. The shuffling is performed in-place, meaning the original array is modified.
      Parameters:
      a - the long array to be shuffled
    • shuffle

      public static void shuffle(long[] a, Random rnd)
      Shuffles the elements of the specified long array using the specified random number generator. The shuffling is performed in-place, meaning the original array is modified.
      Parameters:
      a - the long array to be shuffled
      rnd - the random number generator to use
    • shuffle

      public static void shuffle(float[] a)
      Shuffles the elements of the specified float array. The shuffling is performed in-place, meaning the original array is modified.
      Parameters:
      a - the float array to be shuffled
    • shuffle

      public static void shuffle(float[] a, Random rnd)
      Shuffles the elements of the specified float array using the specified random number generator. The shuffling is performed in-place, meaning the original array is modified.
      Parameters:
      a - the float array to be shuffled
      rnd - the random number generator to use
    • shuffle

      public static void shuffle(double[] a)
      Shuffles the elements of the specified double array. The shuffling is performed in-place, meaning the original array is modified.
      Parameters:
      a - the double array to be shuffled
    • shuffle

      public static void shuffle(double[] a, Random rnd)
      Shuffles the elements of the specified double array using the specified random number generator. The shuffling is performed in-place, meaning the original array is modified.
      Parameters:
      a - the double array to be shuffled
      rnd - the random number generator to use
    • shuffle

      public static void shuffle(Object[] a)
      Shuffles the elements of the specified object array. The shuffling is performed in-place, meaning the original array is modified.
      Parameters:
      a - the object array to be shuffled
    • shuffle

      public static void shuffle(Object[] a, Random rnd)
      Shuffles the elements of the specified object array using the specified random number generator. The shuffling is performed in-place, meaning the original array is modified.
      Parameters:
      a - the object array to be shuffled
      rnd - the random number generator to use
    • shuffle

      public static void shuffle(List<?> list)
      Shuffles the elements of the specified list. The shuffling is performed in-place, meaning the original list is modified.
      Parameters:
      list - the list to be shuffled
      See Also:
    • shuffle

      public static void shuffle(List<?> list, Random rnd)
      Shuffles the elements of the specified list using the specified random number generator. The shuffling is performed in-place, meaning the original list is modified.
      Parameters:
      list - the list to be shuffled
      rnd - the random number generator to use
      See Also:
    • shuffle

      @Beta public static void shuffle(Collection<?> c)
      Shuffles the elements of the specified collection that has a well-defined encounter order. The shuffling is performed in-place, meaning the original collection is modified.
      Parameters:
      c - the collection to be shuffled. It should be a collection that has a well-defined encounter order.
      See Also:
    • shuffle

      @Beta public static void shuffle(Collection<?> c, Random rnd)
      Shuffles the elements of the specified collection that has a well-defined encounter order using the specified random number generator. The shuffling is performed in-place, meaning the original collection is modified.
      Parameters:
      c - the collection to be shuffled. It should be a collection that has a well-defined encounter order.
      rnd - the random number generator to use
      See Also:
    • swap

      public static void swap(boolean[] a, int i, int j)
      Swaps the elements at the specified positions in the specified boolean array.
      Parameters:
      a - the boolean array in which to swap elements
      i - the index of one element to be swapped
      j - the index of the other element to be swapped
    • swap

      public static void swap(char[] a, int i, int j)
      Swaps the elements at the specified positions in the specified char array.
      Parameters:
      a - the char array in which to swap elements
      i - the index of one element to be swapped
      j - the index of the other element to be swapped
    • swap

      public static void swap(byte[] a, int i, int j)
      Swaps the elements at the specified positions in the specified byte array.
      Parameters:
      a - the byte array in which to swap elements
      i - the index of one element to be swapped
      j - the index of the other element to be swapped
    • swap

      public static void swap(short[] a, int i, int j)
      Swaps the elements at the specified positions in the specified short array.
      Parameters:
      a - the short array in which to swap elements
      i - the index of one element to be swapped
      j - the index of the other element to be swapped
    • swap

      public static void swap(int[] a, int i, int j)
      Swaps the elements at the specified positions in the specified int array.
      Parameters:
      a - the int array in which to swap elements
      i - the index of one element to be swapped
      j - the index of the other element to be swapped
    • swap

      public static void swap(long[] a, int i, int j)
      Swaps the elements at the specified positions in the specified long array.
      Parameters:
      a - the long array in which to swap elements
      i - the index of one element to be swapped
      j - the index of the other element to be swapped
    • swap

      public static void swap(float[] a, int i, int j)
      Swaps the elements at the specified positions in the specified float array.
      Parameters:
      a - the float array in which to swap elements
      i - the index of one element to be swapped
      j - the index of the other element to be swapped
    • swap

      public static void swap(double[] a, int i, int j)
      Swaps the elements at the specified positions in the specified double array.
      Parameters:
      a - the double array in which to swap elements
      i - the index of one element to be swapped
      j - the index of the other element to be swapped
    • swap

      public static void swap(Object[] a, int i, int j)
      Swaps the elements at the specified positions in the specified Object array.
      Parameters:
      a - the Object array in which to swap elements
      i - the index of one element to be swapped
      j - the index of the other element to be swapped
    • swap

      public static void swap(List<?> list, int i, int j)
      Swaps the elements at the specified positions in the specified list.
      Parameters:
      list - the list in which to swap elements
      i - the index of one element to be swapped
      j - the index of the other element to be swapped
      See Also:
    • swap

      public static <T> void swap(Pair<T,T> pair)
      Swaps the left and right elements in the specified pair.
      Type Parameters:
      T - the type of the elements in the pair
      Parameters:
      pair - the pair whose elements are to be swapped
    • swapIf

      public static <T> boolean swapIf(Pair<T,T> pair, Predicate<? super Pair<T,T>> predicate)
      Swaps the left and right elements in the specified pair if the specified predicate is true.
      Type Parameters:
      T - the type of the elements in the pair
      Parameters:
      pair - the pair whose elements are to be swapped
      predicate - the predicate to determine if the elements should be swapped
      Returns:
      true if the left and right elements are swapped, otherwise false
    • swap

      public static <T, M> void swap(Triple<T,M,T> triple)
      Swaps the left and right elements in the specified triple.
      Type Parameters:
      T - the type of the elements in the triple
      Parameters:
      triple - the triple whose elements are to be swapped
    • swapIf

      public static <T, M> boolean swapIf(Triple<T,M,T> triple, Predicate<? super Triple<T,M,T>> predicate)
      Swaps the left and right elements in the specified triple if the specified predicate is true.
      Type Parameters:
      T - the type of the elements in the triple
      Parameters:
      triple - the triple whose elements are to be swapped
      predicate - the predicate to determine if the elements should be swapped
      Returns:
      true if the left and right elements are swapped, otherwise false
    • fill

      public static void fill(boolean[] a, boolean val)
      Fills the specified boolean array with the specified value.
      Parameters:
      a - the boolean array to be filled
      val - the boolean value to fill the array with
      See Also:
    • fill

      public static void fill(boolean[] a, int fromIndex, int toIndex, boolean val)
      Fills the specified boolean array with the specified value from the specified fromIndex (inclusive) to the specified toIndex (exclusive).
      Parameters:
      a - the boolean array to be filled
      fromIndex - the index to start filling (inclusive)
      toIndex - the index to stop filling (exclusive)
      val - the boolean value to fill the array with
      Throws:
      IllegalArgumentException - if fromIndex > toIndex
      ArrayIndexOutOfBoundsException - if fromIndex < 0 or toIndex > a.length
      See Also:
    • fill

      public static void fill(char[] a, char val)
      Fills the specified char array with the specified value.
      Parameters:
      a - the char array to be filled
      val - the char value to fill the array with
      See Also:
    • fill

      public static void fill(char[] a, int fromIndex, int toIndex, char val)
      Fills the specified char array with the specified value from the specified fromIndex (inclusive) to the specified toIndex (exclusive).
      Parameters:
      a - the char array to be filled
      fromIndex - the index to start filling (inclusive)
      toIndex - the index to stop filling (exclusive)
      val - the char value to fill the array with
      Throws:
      IllegalArgumentException - if fromIndex > toIndex
      ArrayIndexOutOfBoundsException - if fromIndex < 0 or toIndex > a.length
      See Also:
    • fill

      public static void fill(byte[] a, byte val)
      Fills the specified byte array with the specified value.
      Parameters:
      a - the byte array to be filled
      val - the byte value to fill the array with
      See Also:
    • fill

      public static void fill(byte[] a, int fromIndex, int toIndex, byte val)
      Fills the specified byte array with the specified value from the specified fromIndex (inclusive) to the specified toIndex (exclusive).
      Parameters:
      a - the byte array to be filled
      fromIndex - the index to start filling (inclusive)
      toIndex - the index to stop filling (exclusive)
      val - the byte value to fill the array with
      Throws:
      IllegalArgumentException - if fromIndex > toIndex
      ArrayIndexOutOfBoundsException - if fromIndex < 0 or toIndex > a.length
      See Also:
    • fill

      public static void fill(short[] a, short val)
      Fills the specified short array with the specified value.
      Parameters:
      a - the short array to be filled
      val - the short value to fill the array with
      See Also:
    • fill

      public static void fill(short[] a, int fromIndex, int toIndex, short val)
      Fills the specified short array with the specified value from the specified fromIndex (inclusive) to the specified toIndex (exclusive).
      Parameters:
      a - the short array to be filled
      fromIndex - the index to start filling (inclusive)
      toIndex - the index to stop filling (exclusive)
      val - the short value to fill the array with
      Throws:
      IllegalArgumentException - if fromIndex > toIndex
      ArrayIndexOutOfBoundsException - if fromIndex < 0 or toIndex > a.length
      See Also:
    • fill

      public static void fill(int[] a, int val)
      Fills the specified int array with the specified value.
      Parameters:
      a - the int array to be filled
      val - the int value to fill the array with
      See Also:
    • fill

      public static void fill(int[] a, int fromIndex, int toIndex, int val)
      Fills the specified int array with the specified value from the specified fromIndex (inclusive) to the specified toIndex (exclusive).
      Parameters:
      a - the int array to be filled
      fromIndex - the index to start filling (inclusive)
      toIndex - the index to stop filling (exclusive)
      val - the int value to fill the array with
      Throws:
      IllegalArgumentException - if fromIndex > toIndex
      ArrayIndexOutOfBoundsException - if fromIndex < 0 or toIndex > a.length
      See Also:
    • fill

      public static void fill(long[] a, long val)
      Fills the specified long array with the specified value.
      Parameters:
      a - the long array to be filled
      val - the long value to fill the array with
      See Also:
    • fill

      public static void fill(long[] a, int fromIndex, int toIndex, long val)
      Fills the specified long array with the specified value from the specified fromIndex (inclusive) to the specified toIndex (exclusive).
      Parameters:
      a - the long array to be filled
      fromIndex - the index to start filling (inclusive)
      toIndex - the index to stop filling (exclusive)
      val - the long value to fill the array with
      Throws:
      IllegalArgumentException - if fromIndex > toIndex
      ArrayIndexOutOfBoundsException - if fromIndex < 0 or toIndex > a.length
      See Also:
    • fill

      public static void fill(float[] a, float val)
      Fills the specified float array with the specified value.
      Parameters:
      a - the float array to be filled
      val - the float value to fill the array with
      See Also:
    • fill

      public static void fill(float[] a, int fromIndex, int toIndex, float val)
      Fills the specified float array with the specified value from the specified fromIndex (inclusive) to the specified toIndex (exclusive).
      Parameters:
      a - the float array to be filled
      fromIndex - the index to start filling (inclusive)
      toIndex - the index to stop filling (exclusive)
      val - the float value to fill the array with
      Throws:
      IllegalArgumentException - if fromIndex > toIndex
      ArrayIndexOutOfBoundsException - if fromIndex < 0 or toIndex > a.length
      See Also:
    • fill

      public static void fill(double[] a, double val)
      Fills the specified double array with the specified value.
      Parameters:
      a - the double array to be filled
      val - the double value to fill the array with
      See Also:
    • fill

      public static void fill(double[] a, int fromIndex, int toIndex, double val)
      Fills the specified double array with the specified value from the specified fromIndex (inclusive) to the specified toIndex (exclusive).
      Parameters:
      a - the double array to be filled
      fromIndex - the index to start filling (inclusive)
      toIndex - the index to stop filling (exclusive)
      val - the double value to fill the array with
      Throws:
      IllegalArgumentException - if fromIndex > toIndex
      ArrayIndexOutOfBoundsException - if fromIndex < 0 or toIndex > a.length
      See Also:
    • fill

      public static void fill(Object[] a, Object val)
      Fills the specified Object array with the specified value.
      Parameters:
      a - the Object array to be filled
      val - the Object value to fill the array with
      See Also:
    • fill

      public static void fill(Object[] a, int fromIndex, int toIndex, Object val)
      Fills the specified Object array with the specified value from the specified fromIndex (inclusive) to the specified toIndex (exclusive).
      Parameters:
      a - the Object array to be filled
      fromIndex - the index to start filling (inclusive)
      toIndex - the index to stop filling (exclusive)
      val - the Object value to fill the array with
      Throws:
      IllegalArgumentException - if fromIndex > toIndex
      ArrayIndexOutOfBoundsException - if fromIndex < 0 or toIndex > a.length
      See Also:
    • fill

      public static <T> void fill(List<? super T> list, T val)
      Fills the specified list with the specified value.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      list - the list to be filled
      val - the value to fill the list with
      Throws:
      IllegalArgumentException - if the specified list is null
      See Also:
    • fill

      public static <T> void fill(List<? super T> list, int fromIndex, int toIndex, T val) throws IndexOutOfBoundsException
      Fills the specified list with the specified value from the specified start index to the specified end index. The list will be extended automatically if the size of the list is less than the specified toIndex.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      list - the list to be filled
      fromIndex - the starting index (inclusive) to begin filling
      toIndex - the ending index (exclusive) to stop filling
      val - the value to fill the list with
      Throws:
      IllegalArgumentException - if the specified list is null
      IndexOutOfBoundsException - if the specified indices are out of range
      See Also:
    • fill

      public static void fill(Object bean) throws IllegalArgumentException
      Fills the properties of the specified bean with random values.
      Parameters:
      bean - the bean object with getter/setter methods to be filled with random values
      Throws:
      IllegalArgumentException - if the specified bean is null or the bean class is not a valid JavaBean
    • fill

      public static <T> T fill(Class<? extends T> beanClass) throws IllegalArgumentException
      Fills the properties of a new instance of the specified bean class with random values.
      Type Parameters:
      T - the type of the bean
      Parameters:
      beanClass - the class of the bean to be filled
      Returns:
      a new instance of the specified bean class with properties filled with random values
      Throws:
      IllegalArgumentException - if the specified beanClass is null or the bean class is not a valid JavaBean
    • fill

      public static <T> List<T> fill(Class<? extends T> beanClass, int count) throws IllegalArgumentException
      Returns a list of new instances of the specified bean class with properties filled with random values.
      Type Parameters:
      T - the type of the bean
      Parameters:
      beanClass - the class of the bean to be filled
      count - the number of instances to create and fill
      Returns:
      a list of new instances of the specified bean class with properties filled with random values
      Throws:
      IllegalArgumentException - if the specified beanClass is null or the bean class is not a valid JavaBean
    • padLeft

      public static <T> boolean padLeft(List<T> list, int minSize, T objToAdd) throws IllegalArgumentException
      Appends the provided object to the beginning of the list till the list has at least the specified minimum size.
      Type Parameters:
      T - the type of the elements in the list
      Parameters:
      list - the list to be padded
      minSize - the minimum size the list should have after this operation
      objToAdd - the object to add to the list if it is smaller than the specified minimum size
      Returns:
      true if the list was modified as a result of this operation, false otherwise
      Throws:
      IllegalArgumentException - if the list is null or the minimum size is negative
    • padRight

      public static <T> boolean padRight(Collection<T> c, int minSize, T objToAdd) throws IllegalArgumentException
      Appends the provided object to the end of the collection until the collection has at least the specified minimum size.
      Type Parameters:
      T - the type of elements in the collection
      Parameters:
      c - the collection to be padded
      minSize - the minimum size the collection should have after padding
      objToAdd - the object to be added to the collection
      Returns:
      true if the collection was modified, false otherwise
      Throws:
      IllegalArgumentException - if the collection is null or the minimum size is negative
      See Also:
    • repeat

      public static <T> List<T> repeat(T value, int n) throws IllegalArgumentException
      Repeats the provided value a specified number of times.
      Type Parameters:
      T - the type of the value to be repeated
      Parameters:
      value - the value to be repeated
      n - the number of times to repeat the value
      Returns:
      a list containing the repeated values
      Throws:
      IllegalArgumentException - if the specified number of repetitions is negative
      See Also:
    • repeatElements

      public static <T> List<T> repeatElements(Collection<? extends T> c, int n) throws IllegalArgumentException
      Repeats each element in the specified Collection n times one by one.
       
       repeatElements(N.asList(1, 2, 3), 2) => [1, 1, 2, 2, 3, 3]
       
       
      Type Parameters:
      T - the type of the elements in the collection
      Parameters:
      c - the collection whose elements are to be repeated
      n - the number of times to repeat the elements
      Returns:
      a list containing the repeated elements
      Throws:
      IllegalArgumentException - if the specified collection is null or empty, or specified number of repetitions is negative
      See Also:
    • repeatCollection

      public static <T> List<T> repeatCollection(Collection<T> c, int n) throws IllegalArgumentException
      Repeats the entire specified Collection n times.
       
       repeatCollection(N.asList(1, 2, 3), 2) => [1, 2, 3, 1, 2, 3]
       
       
      Type Parameters:
      T - the type of the elements in the collection
      Parameters:
      c - the collection whose elements are to be repeated
      n - the number of times to repeat the elements
      Returns:
      a list containing the repeated elements
      Throws:
      IllegalArgumentException - if the specified collection is null or empty, or specified number of repetitions is negative
      See Also:
    • repeatElementsToSize

      public static <T> List<T> repeatElementsToSize(Collection<T> c, int size) throws IllegalArgumentException
      Repeats each element in the specified Collection n times one by one till reach the specified size.
       
       repeatElementsToSize(N.asList(1, 2, 3), 5) => [1, 1, 2, 2, 3]
       
       
      Type Parameters:
      T - the type of the elements in the collection
      Parameters:
      c - the collection whose elements are to be repeated
      size - the target size of the resulting list
      Returns:
      a list containing the repeated elements
      Throws:
      IllegalArgumentException - if the specified collection is null or empty, or the specified size is negative
      IllegalArgumentException
      See Also:
    • repeatCollectionToSize

      public static <T> List<T> repeatCollectionToSize(Collection<? extends T> c, int size) throws IllegalArgumentException
      Repeats the entire specified Collection n times till reach the specified size.
       
       repeatCollectionToSize(N.asList(1, 2, 3), 5) => [1, 2, 3, 1, 2]
       
       
      Type Parameters:
      T - the type of the elements in the collection
      Parameters:
      c - the collection whose elements are to be repeated
      size - the target size of the resulting list
      Returns:
      a list containing the repeated elements
      Throws:
      IllegalArgumentException - if the specified collection is null or empty, or the specified size is negative
      See Also:
    • copy

      public static <T> void copy(List<? extends T> src, List<? super T> dest)
      Copies all of the elements from the source list into the destination list. After the operation, the index of each copied element in the destination list will be identical to its index in the source list. The destination list must be at least as long as the source list. If it is longer, the remaining elements in the destination list are unaffected. This method runs in linear time.
      Type Parameters:
      T - the type of elements in the lists
      Parameters:
      src - the source list from which elements are to be copied
      dest - the destination list to which elements are to be copied
      Throws:
      IndexOutOfBoundsException - if the destination list is too small to contain the entire source list
      UnsupportedOperationException - if the destination list's list-iterator does not support the set operation
      See Also:
    • copy

      public static <T> void copy(List<? extends T> src, int srcPos, List<? super T> dest, int destPos, int length) throws IndexOutOfBoundsException
      Copies a portion of one list into another. The portion to be copied begins at the index srcPos in the source list and spans length elements. The elements are copied into the destination list starting at position destPos. Both source and destination positions are zero-based.
      Type Parameters:
      T - the type of elements in the lists
      Parameters:
      src - the source list from which to copy elements
      srcPos - the starting position in the source list
      dest - the destination list into which to copy elements
      destPos - the starting position in the destination list
      length - the number of elements to be copied
      Throws:
      IndexOutOfBoundsException - if copying would cause access of data outside list bounds
    • copy

      public static void copy(boolean[] src, int srcPos, boolean[] dest, int destPos, int length) throws IndexOutOfBoundsException
      Copies elements from the source boolean array to the destination boolean array.
      Parameters:
      src - the source array from which elements are to be copied
      srcPos - starting position in the source array
      dest - the destination array to which elements are to be copied
      destPos - starting position in the destination array
      length - the number of array elements to be copied
      Throws:
      IndexOutOfBoundsException - if copying would cause access of data outside array bounds
      See Also:
    • copy

      public static void copy(char[] src, int srcPos, char[] dest, int destPos, int length) throws IndexOutOfBoundsException
      Copies elements from the source char array to the destination char array.
      Parameters:
      src - the source array from which elements are to be copied
      srcPos - starting position in the source array
      dest - the destination array to which elements are to be copied
      destPos - starting position in the destination array
      length - the number of array elements to be copied
      Throws:
      IndexOutOfBoundsException - if copying would cause access of data outside array bounds
      See Also:
    • copy

      public static void copy(byte[] src, int srcPos, byte[] dest, int destPos, int length) throws IndexOutOfBoundsException
      Copies elements from the source byte array to the destination byte array.
      Parameters:
      src - the source array from which elements are to be copied
      srcPos - starting position in the source array
      dest - the destination array to which elements are to be copied
      destPos - starting position in the destination array
      length - the number of array elements to be copied
      Throws:
      IndexOutOfBoundsException - if copying would cause access of data outside array bounds
      See Also:
    • copy

      public static void copy(short[] src, int srcPos, short[] dest, int destPos, int length) throws IndexOutOfBoundsException
      Copies elements from the source short array to the destination short array.
      Parameters:
      src - the source array from which elements are to be copied
      srcPos - starting position in the source array
      dest - the destination array to which elements are to be copied
      destPos - starting position in the destination array
      length - the number of array elements to be copied
      Throws:
      IndexOutOfBoundsException - if copying would cause access of data outside array bounds
      See Also:
    • copy

      public static void copy(int[] src, int srcPos, int[] dest, int destPos, int length) throws IndexOutOfBoundsException
      Copies elements from the source int array to the destination int array.
      Parameters:
      src - the source array from which elements are to be copied
      srcPos - starting position in the source array
      dest - the destination array to which elements are to be copied
      destPos - starting position in the destination array
      length - the number of array elements to be copied
      Throws:
      IndexOutOfBoundsException - if copying would cause access of data outside array bounds
      See Also:
    • copy

      public static void copy(long[] src, int srcPos, long[] dest, int destPos, int length) throws IndexOutOfBoundsException
      Copies elements from the source long array to the destination long array.
      Parameters:
      src - the source array from which elements are to be copied
      srcPos - starting position in the source array
      dest - the destination array to which elements are to be copied
      destPos - starting position in the destination array
      length - the number of array elements to be copied
      Throws:
      IndexOutOfBoundsException - if copying would cause access of data outside array bounds
      See Also:
    • copy

      public static void copy(float[] src, int srcPos, float[] dest, int destPos, int length) throws IndexOutOfBoundsException
      Copies elements from the source float array to the destination float array.
      Parameters:
      src - the source array from which elements are to be copied
      srcPos - starting position in the source array
      dest - the destination array to which elements are to be copied
      destPos - starting position in the destination array
      length - the number of array elements to be copied
      Throws:
      IndexOutOfBoundsException - if copying would cause access of data outside array bounds
      See Also:
    • copy

      public static void copy(double[] src, int srcPos, double[] dest, int destPos, int length) throws IndexOutOfBoundsException
      Copies elements from the source double array to the destination double array.
      Parameters:
      src - the source array from which elements are to be copied
      srcPos - starting position in the source array
      dest - the destination array to which elements are to be copied
      destPos - starting position in the destination array
      length - the number of array elements to be copied
      Throws:
      IndexOutOfBoundsException - if copying would cause access of data outside array bounds
      See Also:
    • copy

      public static void copy(Object[] src, int srcPos, Object[] dest, int destPos, int length) throws IndexOutOfBoundsException
      Copies elements from the source array to the destination array.
      Parameters:
      src - the source array from which elements are to be copied
      srcPos - starting position in the source array
      dest - the destination array to which elements are to be copied
      destPos - starting position in the destination array
      length - the number of array elements to be copied
      Throws:
      IndexOutOfBoundsException - if copying would cause access of data outside array bounds
      See Also:
    • copy

      public static void copy(Object src, int srcPos, Object dest, int destPos, int length) throws IndexOutOfBoundsException
      Copies elements from the source array to the destination array.
      Parameters:
      src - the source array from which elements are to be copied
      srcPos - starting position in the source array
      dest - the destination array to which elements are to be copied
      destPos - starting position in the destination array
      length - the number of array elements to be copied
      Throws:
      IndexOutOfBoundsException - if copying would cause access of data outside array bounds
      See Also:
    • copyOf

      public static boolean[] copyOf(boolean[] original, int newLength)
      Returns a new boolean array containing a copy of the original array, truncated or padded with false (if necessary) so the copy has the specified length.
      Parameters:
      original - the array to be copied
      newLength - the length of the copy to be returned
      Returns:
      a new boolean array containing a copy of the original array
      Throws:
      IllegalArgumentException - if the specified new length is negative
      See Also:
    • copyOf

      public static char[] copyOf(char[] original, int newLength)
      Returns a new char array containing a copy of the original array, truncated or padded with default value (if necessary) so the copy has the specified length.
      Parameters:
      original - the array to be copied
      newLength - the length of the copy to be returned
      Returns:
      a new char array containing a copy of the original array
      Throws:
      IllegalArgumentException - if the specified new length is negative
      See Also:
    • copyOf

      public static byte[] copyOf(byte[] original, int newLength)
      Returns a new byte array containing a copy of the original array, truncated or padded with default value (if necessary) so the copy has the specified length.
      Parameters:
      original - the array to be copied
      newLength - the length of the copy to be returned
      Returns:
      a new byte array containing a copy of the original array
      Throws:
      IllegalArgumentException - if the specified new length is negative
      See Also:
    • copyOf

      public static short[] copyOf(short[] original, int newLength)
      Returns a new short array containing a copy of the original array, truncated or padded with default value (if necessary) so the copy has the specified length.
      Parameters:
      original - the array to be copied
      newLength - the length of the copy to be returned
      Returns:
      a new short array containing a copy of the original array
      Throws:
      IllegalArgumentException - if the specified new length is negative
      See Also:
    • copyOf

      public static int[] copyOf(int[] original, int newLength)
      Returns a new int array containing a copy of the original array, truncated or padded with default value (if necessary) so the copy has the specified length.
      Parameters:
      original - the array to be copied
      newLength - the length of the copy to be returned
      Returns:
      a new int array containing a copy of the original array
      Throws:
      IllegalArgumentException - if the specified new length is negative
      See Also:
    • copyOf

      public static long[] copyOf(long[] original, int newLength)
      Returns a new long array containing a copy of the original array, truncated or padded with default value (if necessary) so the copy has the specified length.
      Parameters:
      original - the array to be copied
      newLength - the length of the copy to be returned
      Returns:
      a new long array containing a copy of the original array
      Throws:
      IllegalArgumentException - if the specified new length is negative
      See Also:
    • copyOf

      public static float[] copyOf(float[] original, int newLength)
      Returns a new float array containing a copy of the original array, truncated or padded with default value (if necessary) so the copy has the specified length.
      Parameters:
      original - the array to be copied
      newLength - the length of the copy to be returned
      Returns:
      a new float array containing a copy of the original array
      Throws:
      IllegalArgumentException - if the specified new length is negative
      See Also:
    • copyOf

      public static double[] copyOf(double[] original, int newLength)
      Returns a new double array containing a copy of the original array, truncated or padded with default value (if necessary) so the copy has the specified length.
      Parameters:
      original - the array to be copied
      newLength - the length of the copy to be returned
      Returns:
      a new double array containing a copy of the original array
      Throws:
      IllegalArgumentException - if the specified new length is negative
      See Also:
    • copyOf

      public static <T> T[] copyOf(T[] original, int newLength)
      Returns a new Object array containing a copy of the original array, truncated or padded with null (if necessary) so the copy has the specified length.
      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      original - the array to be copied
      newLength - the length of the copy to be returned
      Returns:
      a new Object array containing a copy of the original array
      Throws:
      IllegalArgumentException - if the specified new length is negative
      NullPointerException - if original is null
      See Also:
    • copyOf

      public static <T, U> T[] copyOf(U[] original, int newLength, Class<? extends T[]> newType)
      Returns a new array containing a copy of the original array, truncated or padded with null (if necessary) so the copy has the specified length.
      Type Parameters:
      T - the type of the elements in the array
      U - the type of the elements in the original array
      Parameters:
      original - the array to be copied
      newLength - the length of the copy to be returned
      newType - the class of the copy to be returned
      Returns:
      a new array containing a copy of the original array
      Throws:
      IllegalArgumentException - if the specified new length is negative
      See Also:
    • copyOfRange

      public static boolean[] copyOfRange(boolean[] original, int fromIndex, int toIndex)
      Returns a new boolean array containing a copy of the specified range of the original array.
      Parameters:
      original - the array from which a range is to be copied
      fromIndex - the initial index of the range to be copied, inclusive
      toIndex - the final index of the range to be copied, exclusive
      Returns:
      a new boolean array containing the specified range from the original array
      Throws:
      IndexOutOfBoundsException - if fromIndex is negative or larger than toIndex, or toIndex is larger than the length of array
      NullPointerException - if original is null
      See Also:
    • copyOfRange

      public static boolean[] copyOfRange(boolean[] original, int fromIndex, int toIndex, int step) throws IndexOutOfBoundsException
      Returns a new boolean array containing a copy of the specified range of the original array, with elements selected at intervals defined by the step parameter. If step negative, the elements will be copied in reverse order.
      Parameters:
      original - the array from which a range is to be copied
      fromIndex - the initial index of the range to be copied, inclusive
      toIndex - the final index of the range to be copied, exclusive
      step - the interval between elements to be copied
      Returns:
      a new boolean array containing the specified range from the original array
      Throws:
      IndexOutOfBoundsException - if fromIndex is negative or larger than toIndex, or toIndex is larger than the length of array
      IllegalArgumentException - if step is zero
      NullPointerException - if original is null
      See Also:
    • copyOfRange

      public static char[] copyOfRange(char[] original, int fromIndex, int toIndex)
      Returns a new char array containing a copy of the specified range of the original array.
      Parameters:
      original - the array from which a range is to be copied
      fromIndex - the initial index of the range to be copied, inclusive
      toIndex - the final index of the range to be copied, exclusive
      Returns:
      a new char array containing the specified range from the original array
      Throws:
      IndexOutOfBoundsException - if fromIndex is negative or larger than toIndex, or toIndex is larger than the length of array
      NullPointerException - if original is null
      See Also:
    • copyOfRange

      public static char[] copyOfRange(char[] original, int fromIndex, int toIndex, int step) throws IndexOutOfBoundsException
      Returns a new char array containing a copy of the specified range of the original array, with elements selected at intervals defined by the step parameter. If step negative, the elements will be copied in reverse order.
      Parameters:
      original - the array from which a range is to be copied
      fromIndex - the initial index of the range to be copied, inclusive
      toIndex - the final index of the range to be copied, exclusive
      step - the interval between elements to be copied
      Returns:
      a new char array containing the specified range from the original array
      Throws:
      IndexOutOfBoundsException - if fromIndex is negative or larger than toIndex, or toIndex is larger than the length of array
      IllegalArgumentException - if step is zero
      NullPointerException - if original is null
      See Also:
    • copyOfRange

      public static byte[] copyOfRange(byte[] original, int fromIndex, int toIndex)
      Returns a new byte array containing a copy of the specified range of the original array.
      Parameters:
      original - the array from which a range is to be copied
      fromIndex - the initial index of the range to be copied, inclusive
      toIndex - the final index of the range to be copied, exclusive
      Returns:
      a new byte array containing the specified range from the original array
      Throws:
      IndexOutOfBoundsException - if fromIndex is negative or larger than toIndex, or toIndex is larger than the length of array
      NullPointerException - if original is null
      See Also:
    • copyOfRange

      public static byte[] copyOfRange(byte[] original, int fromIndex, int toIndex, int step) throws IndexOutOfBoundsException
      Returns a new byte array containing a copy of the specified range of the original array, with elements selected at intervals defined by the step parameter. If step negative, the elements will be copied in reverse order.
      Parameters:
      original - the array from which a range is to be copied
      fromIndex - the initial index of the range to be copied, inclusive
      toIndex - the final index of the range to be copied, exclusive
      step - the interval between elements to be copied
      Returns:
      a new byte array containing the specified range from the original array
      Throws:
      IndexOutOfBoundsException - if fromIndex is negative or larger than toIndex, or toIndex is larger than the length of array
      IllegalArgumentException - if step is zero
      NullPointerException - if original is null
      See Also:
    • copyOfRange

      public static short[] copyOfRange(short[] original, int fromIndex, int toIndex)
      Returns a new short array containing a copy of the specified range of the original array.
      Parameters:
      original - the array from which a range is to be copied
      fromIndex - the initial index of the range to be copied, inclusive
      toIndex - the final index of the range to be copied, exclusive
      Returns:
      a new short array containing the specified range from the original array
      Throws:
      IndexOutOfBoundsException - if fromIndex is negative or larger than toIndex, or toIndex is larger than the length of array
      NullPointerException - if original is null
      See Also:
    • copyOfRange

      public static short[] copyOfRange(short[] original, int fromIndex, int toIndex, int step) throws IndexOutOfBoundsException
      Returns a new short array containing a copy of the specified range of the original array, with elements selected at intervals defined by the step parameter. If step negative, the elements will be copied in reverse order.
      Parameters:
      original - the array from which a range is to be copied
      fromIndex - the initial index of the range to be copied, inclusive
      toIndex - the final index of the range to be copied, exclusive
      step - the interval between elements to be copied
      Returns:
      a new short array containing the specified range from the original array
      Throws:
      IndexOutOfBoundsException - if fromIndex is negative or larger than toIndex, or toIndex is larger than the length of array
      IllegalArgumentException - if step is zero
      NullPointerException - if original is null
      See Also:
    • copyOfRange

      public static int[] copyOfRange(int[] original, int fromIndex, int toIndex)
      Returns a new int array containing a copy of the specified range of the original array.
      Parameters:
      original - the array from which a range is to be copied
      fromIndex - the initial index of the range to be copied, inclusive
      toIndex - the final index of the range to be copied, exclusive
      Returns:
      a new int array containing the specified range from the original array
      Throws:
      IndexOutOfBoundsException - if fromIndex is negative or larger than toIndex, or toIndex is larger than the length of array
      NullPointerException - if original is null
      See Also:
    • copyOfRange

      public static int[] copyOfRange(int[] original, int fromIndex, int toIndex, int step) throws IndexOutOfBoundsException
      Returns a new int array containing a copy of the specified range of the original array, with elements selected at intervals defined by the step parameter. If step negative, the elements will be copied in reverse order.
       
       int[] a = { 0, 1, 2, 3, 4, 5 };
       N.copyOfRange(a, 1, 5, 1)); // [1, 2, 3, 4]
       N.copyOfRange(a, 1, 5, 2); // [1, 3]
      
       N.copyOfRange(a, 5, 1, -1); // [5, 4, 3, 2]
       N.copyOfRange(a, 5, 1, -2); // [5, 3]
       N.copyOfRange(a, 5, -1, -1); // [5, 4, 3, 2, 1, 0]
       N.copyOfRange(a, 6, -1, -1); // [5, 4, 3, 2, 1, 0]
       
       
      Parameters:
      original - the array from which a range is to be copied
      fromIndex - the initial index of the range to be copied, inclusive
      toIndex - the final index of the range to be copied, exclusive
      step - the interval between elements to be copied
      Returns:
      a new int array containing the specified range from the original array
      Throws:
      IndexOutOfBoundsException - if fromIndex is negative or larger than toIndex, or toIndex is larger than the length of array
      IllegalArgumentException - if step is zero
      NullPointerException - if original is null
    • copyOfRange

      public static long[] copyOfRange(long[] original, int fromIndex, int toIndex)
      Returns a new long array containing a copy of the specified range of the original array.
      Parameters:
      original - the array from which a range is to be copied
      fromIndex - the initial index of the range to be copied, inclusive
      toIndex - the final index of the range to be copied, exclusive
      Returns:
      a new long array containing the specified range from the original array
      Throws:
      IndexOutOfBoundsException - if fromIndex is negative or larger than toIndex, or toIndex is larger than the length of array
      NullPointerException - if original is null
      See Also:
    • copyOfRange

      public static long[] copyOfRange(long[] original, int fromIndex, int toIndex, int step) throws IndexOutOfBoundsException
      Returns a new long array containing a copy of the specified range of the original array, with elements selected at intervals defined by the step parameter. If step negative, the elements will be copied in reverse order.
      Parameters:
      original - the array from which a range is to be copied
      fromIndex - the initial index of the range to be copied, inclusive
      toIndex - the final index of the range to be copied, exclusive
      step - the interval between elements to be copied
      Returns:
      a new long array containing the specified range from the original array
      Throws:
      IndexOutOfBoundsException - if fromIndex is negative or larger than toIndex, or toIndex is larger than the length of array
      IllegalArgumentException - if step is zero
      NullPointerException - if original is null
      See Also:
    • copyOfRange

      public static float[] copyOfRange(float[] original, int fromIndex, int toIndex)
      Returns a new float array containing a copy of the specified range of the original array.
      Parameters:
      original - the array from which a range is to be copied
      fromIndex - the initial index of the range to be copied, inclusive
      toIndex - the final index of the range to be copied, exclusive
      Returns:
      a new float array containing the specified range from the original array
      Throws:
      IndexOutOfBoundsException - if fromIndex is negative or larger than toIndex, or toIndex is larger than the length of array
      NullPointerException - if original is null
      See Also:
    • copyOfRange

      public static float[] copyOfRange(float[] original, int fromIndex, int toIndex, int step) throws IndexOutOfBoundsException
      Returns a new float array containing a copy of the specified range of the original array, with elements selected at intervals defined by the step parameter. If step negative, the elements will be copied in reverse order.
      Parameters:
      original - the array from which a range is to be copied
      fromIndex - the initial index of the range to be copied, inclusive
      toIndex - the final index of the range to be copied, exclusive
      step - the interval between elements to be copied
      Returns:
      a new float array containing the specified range from the original array
      Throws:
      IndexOutOfBoundsException - if fromIndex is negative or larger than toIndex, or toIndex is larger than the length of array
      IllegalArgumentException - if step is zero
      NullPointerException - if original is null
      See Also:
    • copyOfRange

      public static double[] copyOfRange(double[] original, int fromIndex, int toIndex)
      Returns a new double array containing a copy of the specified range of the original array.
      Parameters:
      original - the array from which a range is to be copied
      fromIndex - the initial index of the range to be copied, inclusive
      toIndex - the final index of the range to be copied, exclusive
      Returns:
      a new double array containing the specified range from the original array
      Throws:
      IndexOutOfBoundsException - if fromIndex is negative or larger than toIndex, or toIndex is larger than the length of array
      NullPointerException - if original is null
      See Also:
    • copyOfRange

      public static double[] copyOfRange(double[] original, int fromIndex, int toIndex, int step) throws IndexOutOfBoundsException
      Returns a new double array containing a copy of the specified range of the original array, with elements selected at intervals defined by the step parameter. If step negative, the elements will be copied in reverse order.
      Parameters:
      original - the array from which a range is to be copied
      fromIndex - the initial index of the range to be copied, inclusive
      toIndex - the final index of the range to be copied, exclusive
      step - the interval between elements to be copied
      Returns:
      a new double array containing the specified range from the original array
      Throws:
      IndexOutOfBoundsException - if fromIndex is negative or larger than toIndex, or toIndex is larger than the length of array
      IllegalArgumentException - if step is zero
      NullPointerException - if original is null
      See Also:
    • copyOfRange

      public static <T> T[] copyOfRange(T[] original, int fromIndex, int toIndex)
      Returns a new Object array containing a copy of the specified range of the original array.
      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      original - the array from which a range is to be copied
      fromIndex - the initial index of the range to be copied, inclusive
      toIndex - the final index of the range to be copied, exclusive
      Returns:
      a new Object array containing the specified range from the original array
      Throws:
      IndexOutOfBoundsException - if fromIndex is negative or larger than toIndex, or toIndex is larger than the length of array
      NullPointerException - if original is null
      See Also:
    • copyOfRange

      public static <T> T[] copyOfRange(T[] original, int fromIndex, int toIndex, int step)
      Returns a new Object array containing a copy of the specified range of the original array, with elements selected at intervals defined by the step parameter. If step negative, the elements will be copied in reverse order.
      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      original - the array from which a range is to be copied
      fromIndex - the initial index of the range to be copied, inclusive
      toIndex - the final index of the range to be copied, exclusive
      step - the interval between elements to be copied
      Returns:
      a new Object array containing the specified range from the original array
      Throws:
      IndexOutOfBoundsException - if fromIndex is negative or larger than toIndex, or toIndex is larger than the length of array
      IllegalArgumentException - if step is zero
      NullPointerException - if original is null
      See Also:
    • copyOfRange

      public static <T, U> T[] copyOfRange(U[] original, int fromIndex, int toIndex, Class<? extends T[]> newType)
      Returns a new array containing a copy of the specified range of the original array.
      Type Parameters:
      T - the type of the elements in the new array
      U - the type of the elements in the original array
      Parameters:
      original - the array from which a range is to be copied
      fromIndex - the initial index of the range to be copied, inclusive
      toIndex - the final index of the range to be copied, exclusive
      newType - the class of the new array
      Returns:
      a new array containing the specified range from the original array
      Throws:
      IndexOutOfBoundsException - if fromIndex is negative or larger than toIndex, or toIndex is larger than the length of array
      NullPointerException - if original is null
      See Also:
    • copyOfRange

      public static <T> T[] copyOfRange(T[] original, int fromIndex, int toIndex, int step, Class<? extends T[]> newType) throws IndexOutOfBoundsException
      Returns a new array containing a copy of the specified range of the original array, with elements selected at intervals defined by the step parameter. If step negative, the elements will be copied in reverse order.
      Type Parameters:
      T - the type of the elements in the new array
      U - the type of the elements in the original array
      Parameters:
      original - the array from which a range is to be copied
      fromIndex - the initial index of the range to be copied, inclusive
      toIndex - the final index of the range to be copied, exclusive
      step - the interval between elements to be copied
      newType - the class of the new array
      Returns:
      a new array containing the specified range from the original array
      Throws:
      IndexOutOfBoundsException - if fromIndex is negative or larger than toIndex, or toIndex is larger than the length of array
      IllegalArgumentException - if step is zero
      NullPointerException - if original is null
      See Also:
    • copyOfRange

      public static <T> List<T> copyOfRange(List<T> c, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a new list containing a copy of the specified range of the original list.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      c - the list from which a range is to be copied
      fromIndex - the initial index of the range to be copied, inclusive
      toIndex - the final index of the range to be copied, exclusive
      Returns:
      a new list containing the specified range from the original list
      Throws:
      IndexOutOfBoundsException - if fromIndex is negative or larger than toIndex, toIndex is greater than the size of list
      NullPointerException - if original is null
    • copyOfRange

      public static <T> List<T> copyOfRange(List<T> c, int fromIndex, int toIndex, int step) throws IndexOutOfBoundsException
      Returns a new list containing a copy of the specified range of the original list, with elements selected at intervals defined by the step parameter. If step negative, the elements will be copied in reverse order.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      c - the list from which a range is to be copied
      fromIndex - the initial index of the range to be copied, inclusive
      toIndex - the final index of the range to be copied, exclusive
      step - the interval between elements to be copied
      Returns:
      a new list containing the specified range from the original list
      Throws:
      IndexOutOfBoundsException - if fromIndex is negative or larger than toIndex, toIndex is greater than the size of list
      IllegalArgumentException - if step is zero
      NullPointerException - if original is null
      See Also:
    • copyOfRange

      public static String copyOfRange(String str, int fromIndex, int toIndex)
      Returns a new string that is a substring of the specified string. The substring begins at the specified fromIndex and extends to the character at index toIndex - 1. Thus, the length of the substring is toIndex - fromIndex.
      Parameters:
      str - the original string from which a range is to be copied
      fromIndex - the beginning index, inclusive
      toIndex - the ending index, exclusive
      Returns:
      the specified substring
      Throws:
      IndexOutOfBoundsException - if the fromIndex is negative, toIndex is greater than the length of the string, or fromIndex is greater than toIndex
    • copyOfRange

      public static String copyOfRange(String str, int fromIndex, int toIndex, int step) throws IndexOutOfBoundsException
      Returns a new string that is a substring of the specified string, with characters selected at intervals defined by the step parameter. If step negative, the characters will be copied in reverse order.
      Parameters:
      str - the original string from which a range is to be copied
      fromIndex - the beginning index, inclusive
      toIndex - the ending index, exclusive
      step - the interval between characters to be copied
      Returns:
      the specified substring
      Throws:
      IndexOutOfBoundsException - if the fromIndex is negative, toIndex is greater than the length of the string, or fromIndex is greater than toIndex
      IllegalArgumentException - if step is zero
      See Also:
    • clone

      @MayReturnNull public static boolean[] clone(boolean[] original)
      Returns a new array that is a clone of the specified array, or null if the original array is null.
      Parameters:
      original - the array to be cloned
      Returns:
      a clone of the original array, or null if the original array is null
    • clone

      @MayReturnNull public static char[] clone(char[] original)
      Returns a new array that is a clone of the specified array, or null if the original array is null.
      Parameters:
      original - the array to be cloned
      Returns:
      a clone of the original array, or null if the original array is null
    • clone

      @MayReturnNull public static byte[] clone(byte[] original)
      Returns a new array that is a clone of the specified array, or null if the original array is null.
      Parameters:
      original - the array to be cloned
      Returns:
      a clone of the original array, or null if the original array is null
    • clone

      @MayReturnNull public static short[] clone(short[] original)
      Returns a new array that is a clone of the specified array, or null if the original array is null.
      Parameters:
      original - the array to be cloned
      Returns:
      a clone of the original array, or null if the original array is null
    • clone

      @MayReturnNull public static int[] clone(int[] original)
      Returns a new array that is a clone of the specified array, or null if the original array is null.
      Parameters:
      original - the array to be cloned
      Returns:
      a clone of the original array, or null if the original array is null
    • clone

      @MayReturnNull public static long[] clone(long[] original)
      Returns a new array that is a clone of the specified array, or null if the original array is null.
      Parameters:
      original - the array to be cloned
      Returns:
      a clone of the original array, or null if the original array is null
    • clone

      @MayReturnNull public static float[] clone(float[] original)
      Returns a new array that is a clone of the specified array, or null if the original array is null.
      Parameters:
      original - the array to be cloned
      Returns:
      a clone of the original array, or null if the original array is null
    • clone

      @MayReturnNull public static double[] clone(double[] original)
      Returns a new array that is a clone of the specified array, or null if the original array is null.
      Parameters:
      original - the array to be cloned
      Returns:
      a clone of the original array, or null if the original array is null
    • clone

      @MayReturnNull public static <T> T[] clone(T[] original)
      Returns a new array that is a clone of the specified array, or null if the original array is null.
      Parameters:
      original - the array to be cloned
      Returns:
      a clone of the original array, or null if the original array is null
    • clone

      @MayReturnNull public static boolean[][] clone(boolean[][] original)
      Clone the original array and its sub arrays. null is returned if the input array is null.
      Parameters:
      original - the 2D array to be cloned
      Returns:
      a clone of the original 2D array, or null if the original array is null
      See Also:
    • clone

      @MayReturnNull public static char[][] clone(char[][] original)
      Clone the original array and its sub arrays. null is returned if the input array is null.
      Parameters:
      original - the 2D array to be cloned
      Returns:
      a clone of the original 2D array, or null if the original array is null
      See Also:
    • clone

      @MayReturnNull public static byte[][] clone(byte[][] original)
      Clone the original array and its sub arrays. null is returned if the input array is null.
      Parameters:
      original - the 2D array to be cloned
      Returns:
      a clone of the original 2D array, or null if the original array is null
      See Also:
    • clone

      @MayReturnNull public static short[][] clone(short[][] original)
      Clone the original array and its sub arrays. null is returned if the input array is null.
      Parameters:
      original - the 2D array to be cloned
      Returns:
      a clone of the original 2D array, or null if the original array is null
      See Also:
    • clone

      @MayReturnNull public static int[][] clone(int[][] original)
      Clone the original array and its sub arrays. null is returned if the input array is null.
      Parameters:
      original - the 2D array to be cloned
      Returns:
      a clone of the original 2D array, or null if the original array is null
      See Also:
    • clone

      @MayReturnNull public static long[][] clone(long[][] original)
      Clone the original array and its sub arrays. null is returned if the input array is null.
      Parameters:
      original - the 2D array to be cloned
      Returns:
      a clone of the original 2D array, or null if the original array is null
      See Also:
    • clone

      @MayReturnNull public static float[][] clone(float[][] original)
      Clone the original array and its sub arrays. null is returned if the input array is null.
      Parameters:
      original - the 2D array to be cloned
      Returns:
      a clone of the original 2D array, or null if the original array is null
      See Also:
    • clone

      @MayReturnNull public static double[][] clone(double[][] original)
      Clone the original array and its sub arrays. null is returned if the input array is null.
      Parameters:
      original - the 2D array to be cloned
      Returns:
      a clone of the original 2D array, or null if the original array is null
      See Also:
    • clone

      @MayReturnNull public static <T> T[][] clone(T[][] original)
      Clone the original array and its sub arrays. null is returned if the input array is null.
      Parameters:
      original - the 2D array to be cloned
      Returns:
      a clone of the original 2D array, or null if the original array is null
      See Also:
    • clone

      @MayReturnNull public static boolean[][][] clone(boolean[][][] original)
      Clone the original array and its sub arrays. null is returned if the input array is null.
      Parameters:
      original - the 3D array to be cloned
      Returns:
      a clone of the original 3D array, or null if the original array is null
      See Also:
    • clone

      @MayReturnNull public static char[][][] clone(char[][][] original)
      Clone the original array and its sub arrays. null is returned if the input array is null.
      Parameters:
      original - the 3D array to be cloned
      Returns:
      a clone of the original 3D array, or null if the original array is null
      See Also:
    • clone

      @MayReturnNull public static byte[][][] clone(byte[][][] original)
      Clone the original array and its sub arrays. null is returned if the input array is null.
      Parameters:
      original - the 3D array to be cloned
      Returns:
      a clone of the original 3D array, or null if the original array is null
      See Also:
    • clone

      @MayReturnNull public static short[][][] clone(short[][][] original)
      Clone the original array and its sub arrays. null is returned if the input array is null.
      Parameters:
      original - the 3D array to be cloned
      Returns:
      a clone of the original 3D array, or null if the original array is null
      See Also:
    • clone

      @MayReturnNull public static int[][][] clone(int[][][] original)
      Clone the original array and its sub arrays. null is returned if the input array is null.
      Parameters:
      original - the 3D array to be cloned
      Returns:
      a clone of the original 3D array, or null if the original array is null
      See Also:
    • clone

      @MayReturnNull public static long[][][] clone(long[][][] original)
      Clone the original array and its sub arrays. null is returned if the input array is null.
      Parameters:
      original - the 3D array to be cloned
      Returns:
      a clone of the original 3D array, or null if the original array is null
      See Also:
    • clone

      @MayReturnNull public static float[][][] clone(float[][][] original)
      Clone the original array and its sub arrays. null is returned if the input array is null.
      Parameters:
      original - the 3D array to be cloned
      Returns:
      a clone of the original 3D array, or null if the original array is null
      See Also:
    • clone

      @MayReturnNull public static double[][][] clone(double[][][] original)
      Clone the original array and its sub arrays. null is returned if the input array is null.
      Parameters:
      original - the 3D array to be cloned
      Returns:
      a clone of the original 3D array, or null if the original array is null
      See Also:
    • clone

      @MayReturnNull public static <T> T[][][] clone(T[][][] original)
      Clone the original array and its sub arrays. null is returned if the input array is null.
      Parameters:
      original - the 3D array to be cloned
      Returns:
      a clone of the original 3D array, or null if the original array is null
      See Also:
    • isSorted

      public static boolean isSorted(boolean[] a)
      Checks if the specified boolean array is sorted in ascending order.
      Parameters:
      a - the boolean array to be checked
      Returns:
      true if the array is sorted in ascending order, false otherwise
    • isSorted

      public static boolean isSorted(boolean[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Checks if the specified range of the boolean array is sorted in ascending order.
      Parameters:
      a - the boolean array to be checked
      fromIndex - the starting index (inclusive) of the range to be checked
      toIndex - the ending index (exclusive) of the range to be checked
      Returns:
      true if the specified range of the array is sorted in ascending order, false otherwise
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
    • isSorted

      public static boolean isSorted(char[] a)
      Checks if the specified char array is sorted in ascending order.
      Parameters:
      a - the char array to be checked
      Returns:
      true if the array is sorted in ascending order, false otherwise
    • isSorted

      public static boolean isSorted(char[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Checks if the specified range of the char array is sorted in ascending order.
      Parameters:
      a - the array to be checked
      fromIndex - the starting index (inclusive) of the range to be checked
      toIndex - the ending index (exclusive) of the range to be checked
      Returns:
      true if the specified range of the array is sorted in ascending order, false otherwise
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
    • isSorted

      public static boolean isSorted(byte[] a)
      Checks if the specified byte array is sorted in ascending order.
      Parameters:
      a - the byte array to be checked
      Returns:
      true if the array is sorted in ascending order, false otherwise
    • isSorted

      public static boolean isSorted(byte[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Checks if the specified range of the byte array is sorted in ascending order.
      Parameters:
      a - the array to be checked
      fromIndex - the starting index (inclusive) of the range to be checked
      toIndex - the ending index (exclusive) of the range to be checked
      Returns:
      true if the specified range of the array is sorted in ascending order, false otherwise
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
    • isSorted

      public static boolean isSorted(short[] a)
      Checks if the specified byte short is sorted in ascending order.
      Parameters:
      a - the short array to be checked
      Returns:
      true if the array is sorted in ascending order, false otherwise
    • isSorted

      public static boolean isSorted(short[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Checks if the specified range of the short array is sorted in ascending order.
      Parameters:
      a - the array to be checked
      fromIndex - the starting index (inclusive) of the range to be checked
      toIndex - the ending index (exclusive) of the range to be checked
      Returns:
      true if the specified range of the array is sorted in ascending order, false otherwise
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
    • isSorted

      public static boolean isSorted(int[] a)
      Checks if the specified integer array is sorted in ascending order.
      Parameters:
      a - the integer array to be checked
      Returns:
      true if the array is sorted in ascending order, false otherwise
    • isSorted

      public static boolean isSorted(int[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Checks if the specified range of the integer array is sorted in ascending order.
      Parameters:
      a - the array to be checked
      fromIndex - the starting index (inclusive) of the range to be checked
      toIndex - the ending index (exclusive) of the range to be checked
      Returns:
      true if the specified range of the array is sorted in ascending order, false otherwise
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
    • isSorted

      public static boolean isSorted(long[] a)
      Checks if the specified long array is sorted in ascending order.
      Parameters:
      a - the long array to be checked
      Returns:
      true if the array is sorted in ascending order, false otherwise
    • isSorted

      public static boolean isSorted(long[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Checks if the specified range of the long array is sorted in ascending order.
      Parameters:
      a - the array to be checked
      fromIndex - the starting index (inclusive) of the range to be checked
      toIndex - the ending index (exclusive) of the range to be checked
      Returns:
      true if the specified range of the array is sorted in ascending order, false otherwise
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
    • isSorted

      public static boolean isSorted(float[] a)
      Checks if the specified float array is sorted in ascending order.
      Parameters:
      a - the float array to be checked
      Returns:
      true if the array is sorted in ascending order, false otherwise
    • isSorted

      public static boolean isSorted(float[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Checks if the specified range of the float array is sorted in ascending order.
      Parameters:
      a - the array to be checked
      fromIndex - the starting index (inclusive) of the range to be checked
      toIndex - the ending index (exclusive) of the range to be checked
      Returns:
      true if the specified range of the array is sorted in ascending order, false otherwise
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
    • isSorted

      public static boolean isSorted(double[] a)
      Checks if the specified double array is sorted in ascending order.
      Parameters:
      a - the double array to be checked
      Returns:
      true if the array is sorted in ascending order, false otherwise
    • isSorted

      public static boolean isSorted(double[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Checks if the specified range of the double array is sorted in ascending order.
      Parameters:
      a - the array to be checked
      fromIndex - the starting index (inclusive) of the range to be checked
      toIndex - the ending index (exclusive) of the range to be checked
      Returns:
      true if the specified range of the array is sorted in ascending order, false otherwise
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
    • isSorted

      public static <T extends Comparable<? super T>> boolean isSorted(T[] a)
      Checks if the specified array is sorted in ascending order (where null is smallest).
      Type Parameters:
      T - the type of elements in the array, which must be Comparable
      Parameters:
      a - the array to be checked
      Returns:
      true if the array is sorted in ascending order, false otherwise
      See Also:
    • isSorted

      public static <T extends Comparable<? super T>> boolean isSorted(T[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Checks if the specified range of the array is sorted in ascending order (where null is smallest).
      Type Parameters:
      T - the type of elements in the array, which must be Comparable
      Parameters:
      a - the array to be checked
      fromIndex - the starting index (inclusive) of the range to be checked
      toIndex - the ending index (exclusive) of the range to be checked
      Returns:
      true if the specified range of the array is sorted in ascending order, false otherwise
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
      See Also:
    • isSorted

      public static <T> boolean isSorted(T[] a, Comparator<? super T> cmp)
      Checks if the array is sorted according to the order induced by the specified comparator.
      Type Parameters:
      T - the type of elements in the array
      Parameters:
      a - the array to be checked
      cmp - the comparator to determine the order of the array
      Returns:
      true if the array is sorted according to the specified comparator, false otherwise
      See Also:
    • isSorted

      public static <T> boolean isSorted(T[] a, int fromIndex, int toIndex, Comparator<? super T> cmp) throws IndexOutOfBoundsException
      Checks if the specified range of the array is sorted according to the order induced by the specified comparator.
      Type Parameters:
      T - the type of elements in the array
      Parameters:
      a - the array to be checked
      fromIndex - the starting index (inclusive) of the range to be checked
      toIndex - the ending index (exclusive) of the range to be checked
      cmp - the comparator to determine the order of the array
      Returns:
      true if the specified range of the array is sorted according to the specified comparator, false otherwise
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
      See Also:
    • isSorted

      public static <T extends Comparable<? super T>> boolean isSorted(Collection<? extends T> c)
      Checks if the collection is sorted in ascending order (where null is smallest).
      Type Parameters:
      T - the type of elements in the collection
      Parameters:
      c - the collection to be checked
      Returns:
      true if the collection is sorted in natural order, false otherwise
      See Also:
    • isSorted

      public static <T extends Comparable<? super T>> boolean isSorted(Collection<? extends T> c, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Checks if the specified range of the collection is sorted in ascending order (where null is smallest).
      Type Parameters:
      T - the type of elements in the collection
      Parameters:
      c - the collection to be checked
      fromIndex - the starting index (inclusive) of the range to be checked
      toIndex - the ending index (exclusive) of the range to be checked
      Returns:
      true if the specified range of the collection is sorted in natural order, false otherwise
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
      See Also:
    • isSorted

      public static <T> boolean isSorted(Collection<? extends T> c, Comparator<? super T> cmp)
      Checks if the collection is sorted according to the order induced by the specified comparator.
      Type Parameters:
      T - the type of elements in the collection
      Parameters:
      c - the collection to be checked
      cmp - the comparator to determine the order of the collection
      Returns:
      true if the collection is sorted according to the specified comparator, false otherwise
      See Also:
    • isSorted

      public static <T> boolean isSorted(Collection<? extends T> c, int fromIndex, int toIndex, Comparator<? super T> cmp) throws IndexOutOfBoundsException
      Checks if the specified range of the collection is sorted according to the order induced by the specified comparator.
      Type Parameters:
      T - the type of elements in the collection
      Parameters:
      c - the collection to be checked
      fromIndex - the starting index (inclusive) of the range to be checked
      toIndex - the ending index (exclusive) of the range to be checked
      cmp - the comparator to determine the order of the collection
      Returns:
      true if the specified range of the collection is sorted according to the specified comparator, false otherwise
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
      See Also:
    • sort

      public static void sort(boolean[] a)
      Sorts the specified array of booleans into ascending order. false is considered less than true.
      Parameters:
      a - the array to be sorted
    • sort

      public static void sort(boolean[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Sorts the specified range of the array into ascending order. false is considered less than true.
      Parameters:
      a - the array to be sorted
      fromIndex - the index of the first element (inclusive) to be sorted
      toIndex - the index of the last element (exclusive) to be sorted
      Throws:
      ArrayIndexOutOfBoundsException - if fromIndex or toIndex is out of range
      IndexOutOfBoundsException
    • sort

      public static void sort(char[] a)
      Sorts the specified array into ascending order.
      Parameters:
      a - the array to be sorted
    • sort

      public static void sort(char[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Sorts the specified range of the array into ascending order.
      Parameters:
      a - the array to be sorted
      fromIndex - the index of the first element (inclusive) to be sorted
      toIndex - the index of the last element (exclusive) to be sorted
      Throws:
      ArrayIndexOutOfBoundsException - if fromIndex or toIndex is out of range
      IndexOutOfBoundsException
    • sort

      public static void sort(byte[] a)
      Sorts the specified array into ascending numerical order.
      Parameters:
      a - the array to be sorted
    • sort

      public static void sort(byte[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Sorts the specified range of the array into ascending order.
      Parameters:
      a - the array to be sorted
      fromIndex - the index of the first element (inclusive) to be sorted
      toIndex - the index of the last element (exclusive) to be sorted
      Throws:
      ArrayIndexOutOfBoundsException - if fromIndex or toIndex is out of range
      IndexOutOfBoundsException
    • sort

      public static void sort(short[] a)
      Sorts the specified array into ascending numerical order.
      Parameters:
      a - the array to be sorted
    • sort

      public static void sort(short[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Sorts the specified range of the array into ascending order.
      Parameters:
      a - the array to be sorted
      fromIndex - the index of the first element (inclusive) to be sorted
      toIndex - the index of the last element (exclusive) to be sorted
      Throws:
      ArrayIndexOutOfBoundsException - if fromIndex or toIndex is out of range
      IndexOutOfBoundsException
    • sort

      public static void sort(int[] a)
      Sorts the specified array into ascending numerical order.
      Parameters:
      a - the array to be sorted
    • sort

      public static void sort(int[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Sorts the specified range of the array into ascending order.
      Parameters:
      a - the array to be sorted
      fromIndex - the index of the first element (inclusive) to be sorted
      toIndex - the index of the last element (exclusive) to be sorted
      Throws:
      ArrayIndexOutOfBoundsException - if fromIndex or toIndex is out of range
      IndexOutOfBoundsException
    • sort

      public static void sort(long[] a)
      Sorts the specified array into ascending numerical order.
      Parameters:
      a - the array to be sorted
    • sort

      public static void sort(long[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Sorts the specified range of the array into ascending order.
      Parameters:
      a - the array to be sorted
      fromIndex - the index of the first element (inclusive) to be sorted
      toIndex - the index of the last element (exclusive) to be sorted
      Throws:
      ArrayIndexOutOfBoundsException - if fromIndex or toIndex is out of range
      IndexOutOfBoundsException
    • sort

      public static void sort(float[] a)
      Sorts the specified array into ascending numerical order.
      Parameters:
      a - the array to be sorted
    • sort

      public static void sort(float[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Sorts the specified range of the array into ascending order.
      Parameters:
      a - the array to be sorted
      fromIndex - the index of the first element (inclusive) to be sorted
      toIndex - the index of the last element (exclusive) to be sorted
      Throws:
      ArrayIndexOutOfBoundsException - if fromIndex or toIndex is out of range
      IndexOutOfBoundsException
    • sort

      public static void sort(double[] a)
      Sorts the specified array into ascending order.
      Parameters:
      a - the array to be sorted
    • sort

      public static void sort(double[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Sorts the specified range of the array into ascending order.
      Parameters:
      a - the array to be sorted
      fromIndex - the index of the first element (inclusive) to be sorted
      toIndex - the index of the last element (exclusive) to be sorted
      Throws:
      ArrayIndexOutOfBoundsException - if fromIndex or toIndex is out of range
      IndexOutOfBoundsException
    • sort

      public static void sort(Object[] a)
      Sorts the specified array according to the natural ordering (where null is smallest).
      Parameters:
      a - the array to be sorted
      Throws:
      ClassCastException - if the array contains elements that are not mutually comparable
      See Also:
    • sort

      public static void sort(Object[] a, int fromIndex, int toIndex)
      Sorts the specified range of the specified array according to the natural ordering (where null is smallest).
      Parameters:
      a - the array to be sorted
      fromIndex - the index of the first element (inclusive) to be sorted
      toIndex - the index of the last element (exclusive) to be sorted
      Throws:
      ArrayIndexOutOfBoundsException - if fromIndex or toIndex is out of range
      See Also:
    • sort

      public static <T> void sort(T[] a, Comparator<? super T> cmp)
      Sorts the specified array according to the order induced by the specified comparator.
      Type Parameters:
      T - the type of the objects being compared
      Parameters:
      a - the array to be sorted
      cmp - the comparator to determine the order of the array. A null value indicates that the elements' natural ordering should be used.
      See Also:
    • sort

      public static <T> void sort(T[] a, int fromIndex, int toIndex, Comparator<? super T> cmp) throws IndexOutOfBoundsException
      Sorts the specified range of the specified array according to the order induced by the specified comparator.
      Type Parameters:
      T - the type of the objects being compared
      Parameters:
      a - the array to be sorted
      fromIndex - the index of the first element (inclusive) to be sorted
      toIndex - the index of the last element (exclusive) to be sorted
      cmp - the comparator to determine the order of the array. A null value indicates that the elements' natural ordering should be used.
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
      See Also:
    • sort

      public static <T extends Comparable<? super T>> void sort(List<? extends T> list)
      Sorts the specified list according to the natural ordering (where null is smallest).
      Type Parameters:
      T - the type of the elements in the list
      Parameters:
      list - the list to be sorted
      See Also:
    • sort

      public static <T extends Comparable<? super T>> void sort(List<? extends T> list, int fromIndex, int toIndex)
      Sorts the specified range of the specified list according to the natural ordering (where null is smallest).
      Type Parameters:
      T - the type of the elements in the list
      Parameters:
      list - the list to be sorted
      fromIndex - the index of the first element (inclusive) to be sorted
      toIndex - the index of the last element (exclusive) to be sorted
      Throws:
      IndexOutOfBoundsException - if the specified range is out of
      See Also:
    • sort

      public static <T> void sort(List<? extends T> list, Comparator<? super T> cmp)
      Sorts the specified list according to the order induced by the specified comparator.
      Type Parameters:
      T - the type of the elements in the list
      Parameters:
      list - the list to be sorted
      cmp - the comparator to determine the order of the list. A null value indicates that the elements' natural ordering should be used
      See Also:
    • sort

      public static <T> void sort(List<? extends T> list, int fromIndex, int toIndex, Comparator<? super T> cmp)
      Sorts the specified range of the list according to the order induced by the specified comparator.
      Type Parameters:
      T - the type of the elements in the list
      Parameters:
      list - the list to be sorted
      fromIndex - the index of the first element (inclusive) to be sorted
      toIndex - the index of the last element (exclusive) to be sorted
      cmp - the comparator to determine the order of the list. A null value indicates that the elements' natural ordering should be used.
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
      See Also:
    • sortBy

      public static <T, U extends Comparable<? super U>> void sortBy(T[] a, Function<? super T,? extends U> keyExtractor)
      Sorts the specified array based on the keys extracted by the provided Function.
      Type Parameters:
      T - the type of elements in the array
      U - the type of the key values, which must be comparable
      Parameters:
      a - the array to be sorted
      keyExtractor - the function to extract the key values from the array elements
      See Also:
    • sortBy

      public static <T, U extends Comparable<? super U>> void sortBy(List<? extends T> list, Function<? super T,? extends U> keyExtractor)
      Sorts the specified list based on the keys extracted by the provided Function.
      Type Parameters:
      T - the type of elements in the list
      U - the type of the key values, which must be comparable
      Parameters:
      keyExtractor - the function to extract the key values from the list elements
      a - the array to be sorted
      See Also:
    • sortByInt

      public static <T> void sortByInt(T[] a, ToIntFunction<? super T> keyExtractor)
      Sorts the specified array into ascending numerical order based on the keys extracted by the provided ToIntFunction.
      Type Parameters:
      T - the type of elements in the array
      Parameters:
      a - the array to be sorted
      keyExtractor - the function to extract the key values from the array elements
    • sortByInt

      public static <T> void sortByInt(List<? extends T> list, ToIntFunction<? super T> keyExtractor)
      Sorts the specified list into ascending numerical order based on the keys extracted by the provided ToIntFunction.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      list - the list to be sorted
      keyExtractor - the function to extract the key values from the list elements
    • sortByLong

      public static <T> void sortByLong(T[] a, ToLongFunction<? super T> keyExtractor)
      Sorts the specified array into ascending numerical order based on the keys extracted by the provided ToLongFunction.
      Type Parameters:
      T - the type of elements in the array
      Parameters:
      a - the array to be sorted
      keyExtractor - the function to extract the key values from the array elements
    • sortByLong

      public static <T> void sortByLong(List<? extends T> list, ToLongFunction<? super T> keyExtractor)
      Sorts the specified list into ascending numerical order based on the keys extracted by the provided ToLongFunction.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      list - the list to be sorted
      keyExtractor - the function to extract the key values from the list elements
    • sortByFloat

      public static <T> void sortByFloat(T[] a, ToFloatFunction<? super T> keyExtractor)
      Sorts the specified array into ascending numerical order based on the keys extracted by the provided ToFloatFunction.
      Type Parameters:
      T - the type of elements in the array
      Parameters:
      a - the array to be sorted
      keyExtractor - the function to extract the key values from the array elements
    • sortByFloat

      public static <T> void sortByFloat(List<? extends T> list, ToFloatFunction<? super T> keyExtractor)
      Sorts the specified list into ascending numerical order based on the keys extracted by the provided ToFloatFunction.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      list - the list to be sorted
      keyExtractor - the function to extract the key values from the list elements
    • sortByDouble

      public static <T> void sortByDouble(T[] a, ToDoubleFunction<? super T> keyExtractor)
      Sorts the specified array into ascending numerical order based on the keys extracted by the provided ToDoubleFunction.
      Type Parameters:
      T - the type of elements in the array
      Parameters:
      a - the array to be sorted
      keyExtractor - the function to extract the key values from the array elements
    • sortByDouble

      public static <T> void sortByDouble(List<? extends T> list, ToDoubleFunction<? super T> keyExtractor)
      Sorts the specified list into ascending numerical order based on the keys extracted by the provided ToDoubleFunction.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      list - the list to be sorted
      keyExtractor - the function to extract the key values from the list elements
    • parallelSort

      public static void parallelSort(char[] a)
      Sorts the specified array into ascending numerical order by multiple threads.
      Parameters:
      a - the array to be sorted
      See Also:
    • parallelSort

      public static void parallelSort(char[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Sorts the specified range of the array into ascending numerical order by multiple threads.
      Parameters:
      a - the array to be sorted
      fromIndex - the index of the first element (inclusive) to be sorted
      toIndex - the index of the last element (exclusive) to be sorted
      Throws:
      IndexOutOfBoundsException - if the fromIndex or toIndex is out of range
      See Also:
    • parallelSort

      public static void parallelSort(byte[] a)
      Sorts the specified array into ascending numerical order by multiple threads.
      Parameters:
      a - the array to be sorted
      See Also:
    • parallelSort

      public static void parallelSort(byte[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Sorts the specified range of the array into ascending numerical order by multiple threads.
      Parameters:
      a - the array to be sorted
      fromIndex - the index of the first element (inclusive) to be sorted
      toIndex - the index of the last element (exclusive) to be sorted
      Throws:
      IndexOutOfBoundsException - if the fromIndex or toIndex is out of range
      See Also:
    • parallelSort

      public static void parallelSort(short[] a)
      Sorts the specified array into ascending numerical order by multiple threads.
      Parameters:
      a - the array to be sorted
      See Also:
    • parallelSort

      public static void parallelSort(short[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Sorts the specified range of the array into ascending numerical order by multiple threads.
      Parameters:
      a - the array to be sorted
      fromIndex - the index of the first element (inclusive) to be sorted
      toIndex - the index of the last element (exclusive) to be sorted
      Throws:
      IndexOutOfBoundsException - if the fromIndex or toIndex is out of range
      See Also:
    • parallelSort

      public static void parallelSort(int[] a)
      Sorts the specified array into ascending numerical order by multiple threads.
      Parameters:
      a - the array to be sorted
      See Also:
    • parallelSort

      public static void parallelSort(int[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Sorts the specified range of the array into ascending numerical order by multiple threads.
      Parameters:
      a - the array to be sorted
      fromIndex - the index of the first element (inclusive) to be sorted
      toIndex - the index of the last element (exclusive) to be sorted
      Throws:
      IndexOutOfBoundsException - if the fromIndex or toIndex is out of range
      See Also:
    • parallelSort

      public static void parallelSort(long[] a)
      Sorts the specified array into ascending numerical order by multiple threads.
      Parameters:
      a - the array to be sorted
      See Also:
    • parallelSort

      public static void parallelSort(long[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Sorts the specified range of the array into ascending numerical order by multiple threads.
      Parameters:
      a - the array to be sorted
      fromIndex - the index of the first element (inclusive) to be sorted
      toIndex - the index of the last element (exclusive) to be sorted
      Throws:
      IndexOutOfBoundsException - if the fromIndex or toIndex is out of range
      See Also:
    • parallelSort

      public static void parallelSort(float[] a)
      Sorts the specified array into ascending numerical order by multiple threads.
      Parameters:
      a - the array to be sorted
      See Also:
    • parallelSort

      public static void parallelSort(float[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Sorts the specified range of the array into ascending numerical order by multiple threads.
      Parameters:
      a - the array to be sorted
      fromIndex - the index of the first element (inclusive) to be sorted
      toIndex - the index of the last element (exclusive) to be sorted
      Throws:
      IndexOutOfBoundsException - if the fromIndex or toIndex is out of range
      See Also:
    • parallelSort

      public static void parallelSort(double[] a)
      Sorts the specified array into ascending numerical order by multiple threads.
      Parameters:
      a - the array to be sorted
      See Also:
    • parallelSort

      public static void parallelSort(double[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Sorts the specified range of the array into ascending numerical order by multiple threads.
      Parameters:
      a - the array to be sorted
      fromIndex - the index of the first element (inclusive) to be sorted
      toIndex - the index of the last element (exclusive) to be sorted
      Throws:
      IndexOutOfBoundsException - if the fromIndex or toIndex is out of range
      See Also:
    • parallelSort

      public static <T extends Comparable<? super T>> void parallelSort(T[] a)
      Sorts the specified array according to the natural ordering (where null is minimum) by multiple threads.
      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the array to be sorted
      See Also:
    • parallelSort

      public static <T extends Comparable<? super T>> void parallelSort(T[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Sorts the specified range of the specified array according to the natural ordering (where null is minimum) by multiple threads.
      Parameters:
      a - the array to be sorted
      fromIndex - the index of the first element (inclusive) to be sorted
      toIndex - the index of the last element (exclusive) to be sorted
      Throws:
      IllegalArgumentException - if fromIndex > toIndex
      ArrayIndexOutOfBoundsException - if fromIndex or toIndex is out of range
      IndexOutOfBoundsException
      See Also:
    • parallelSort

      public static <T> void parallelSort(T[] a, Comparator<? super T> cmp)
      Sorts the specified array according to the order induced by the specified comparator by multiple threads.
      Type Parameters:
      T - the type of the objects being compared
      Parameters:
      a - the array to be sorted
      cmp - the comparator to determine the order of the array. A null value indicates that the elements' natural ordering should be used.
      See Also:
    • parallelSort

      public static <T> void parallelSort(T[] a, int fromIndex, int toIndex, Comparator<? super T> cmp) throws IndexOutOfBoundsException
      Sorts the specified range of the specified array according to the order induced by the specified comparator by multiple threads.
      Type Parameters:
      T - the type of the objects being compared
      Parameters:
      a - the array to be sorted
      fromIndex - the index of the first element (inclusive) to be sorted
      toIndex - the index of the last element (exclusive) to be sorted
      cmp - the comparator to determine the order of the array. A null value indicates that the elements' natural ordering should be used.
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
      See Also:
    • parallelSort

      public static <T extends Comparable<? super T>> void parallelSort(List<? extends T> list)
      Sorts the specified list according to the natural ordering (where null is minimum) by multiple threads.
      Type Parameters:
      T - the type of the elements in the list
      Parameters:
      list - the list to be sorted
      See Also:
    • parallelSort

      public static <T extends Comparable<? super T>> void parallelSort(List<? extends T> list, int fromIndex, int toIndex)
      Sorts the specified range of the specified list according to the natural ordering (where null is minimum) by multiple threads.
      Type Parameters:
      T - the type of the elements in the list
      Parameters:
      list - the list to be sorted
      fromIndex - the index of the first element (inclusive) to be sorted
      toIndex - the index of the last element (exclusive) to be sorted
      Throws:
      IndexOutOfBoundsException - if the specified range is out of
      See Also:
    • parallelSort

      public static <T> void parallelSort(List<? extends T> list, Comparator<? super T> cmp)
      Sorts the specified list according to the order induced by the specified comparator by multiple threads.
      Type Parameters:
      T - the type of the elements in the list
      Parameters:
      list - the list to be sorted
      cmp - the comparator to determine the order of the list. A null value indicates that the elements' natural ordering should be used
      See Also:
    • parallelSort

      public static <T> void parallelSort(List<? extends T> list, int fromIndex, int toIndex, Comparator<? super T> cmp)
      Sorts the specified range of the list according to the order induced by the specified comparator by multiple threads.
      Type Parameters:
      T - the type of the elements in the list
      Parameters:
      list - the list to be sorted
      fromIndex - the index of the first element (inclusive) to be sorted
      toIndex - the index of the last element (exclusive) to be sorted
      cmp - the comparator to determine the order of the list. A null value indicates that the elements' natural ordering should be used.
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
      See Also:
    • parallelSortBy

      public static <T, U extends Comparable<? super U>> void parallelSortBy(T[] a, Function<? super T,? extends U> keyExtractor)
      Sorts the specified array based on the keys extracted by the provided Function by multiple threads.
      Type Parameters:
      T - the type of the elements in the array
      U - the type of the keys extracted by the key extractor function
      Parameters:
      a - the array to be sorted
      keyExtractor - the function used to extract the keys for comparison
      See Also:
    • parallelSortBy

      public static <T, U extends Comparable<? super U>> void parallelSortBy(List<? extends T> list, Function<? super T,? extends U> keyExtractor)
      Sorts the specified list based on the keys extracted by the provided Function by multiple threads.
      Type Parameters:
      T - the type of the elements in the list
      U - the type of the keys extracted by the key extractor function
      Parameters:
      list - the list to be sorted
      keyExtractor - the function used to extract the keys for comparison
      See Also:
    • parallelSortByInt

      public static <T> void parallelSortByInt(T[] a, ToIntFunction<? super T> keyExtractor)
      Sorts the specified array based on the int values extracted by the provided ToIntFunction by multiple threads.
      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the array to be sorted
      keyExtractor - the function used to extract the int key for comparison
    • parallelSortByInt

      public static <T> void parallelSortByInt(List<? extends T> list, ToIntFunction<? super T> keyExtractor)
      Sorts the specified list based on the int values extracted by the provided ToIntFunction by multiple threads.
      Type Parameters:
      T - the type of the elements in the list
      Parameters:
      list - the list to be sorted
      keyExtractor - the function used to extract the int key for comparison
    • parallelSortByLong

      public static <T> void parallelSortByLong(T[] a, ToLongFunction<? super T> keyExtractor)
      Sorts the specified array based on the long values extracted by the provided ToLongFunction by multiple threads.
      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the array to be sorted
      keyExtractor - the function used to extract the long key for comparison
    • parallelSortByLong

      public static <T> void parallelSortByLong(List<? extends T> list, ToLongFunction<? super T> keyExtractor)
      Sorts the specified list based on the long values extracted by the provided ToLongFunction by multiple threads.
      Type Parameters:
      T - the type of the elements in the list
      Parameters:
      list - the list to be sorted
      keyExtractor - the function used to extract the long key for comparison
    • parallelSortByFloat

      public static <T> void parallelSortByFloat(T[] a, ToFloatFunction<? super T> keyExtractor)
      Sorts the specified array based on the float values extracted by the provided ToFloatFunction by multiple threads.
      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the array to be sorted
      keyExtractor - the function used to extract the float key for comparison
    • parallelSortByFloat

      public static <T> void parallelSortByFloat(List<? extends T> list, ToFloatFunction<? super T> keyExtractor)
      Sorts the specified list based on the float values extracted by the provided ToFloatFunction by multiple threads.
      Type Parameters:
      T - the type of the elements in the list
      Parameters:
      list - the list to be sorted
      keyExtractor - the function used to extract the float key for comparison
    • parallelSortByDouble

      public static <T> void parallelSortByDouble(T[] a, ToDoubleFunction<? super T> keyExtractor)
      Sorts the specified array based on the double values extracted by the provided ToDoubleFunction by multiple threads.
      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the array to be sorted
      keyExtractor - the function used to extract the double key for comparison
    • parallelSortByDouble

      public static <T> void parallelSortByDouble(List<? extends T> list, ToDoubleFunction<? super T> keyExtractor)
      Sorts the specified list based on the double values extracted by the provided ToDoubleFunction by multiple threads.
      Type Parameters:
      T - the type of the elements in the list
      Parameters:
      list - the list to be sorted
      keyExtractor - the function used to extract the double key for comparison
    • reverseSort

      public static void reverseSort(boolean[] a)
      Sorts the specified array of booleans in reverse order.
      Parameters:
      a - the array to be sorted
    • reverseSort

      public static void reverseSort(boolean[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Sorts the specified range of the array of booleans in reverse order.
      Parameters:
      a - the array to be sorted
      fromIndex - the index of the first element (inclusive) to be sorted
      toIndex - the index of the last element (exclusive) to be sorted
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
    • reverseSort

      public static void reverseSort(char[] a)
      Sorts the specified array of characters in reverse order.
      Parameters:
      a - the array to be sorted
    • reverseSort

      public static void reverseSort(char[] a, int fromIndex, int toIndex) throws ArrayIndexOutOfBoundsException
      Sorts the specified range of the array of characters in reverse order.
      Parameters:
      a - the array to be sorted
      fromIndex - the index of the first element (inclusive) to be sorted
      toIndex - the index of the last element (exclusive) to be sorted
      Throws:
      ArrayIndexOutOfBoundsException - if fromIndex or toIndex is out of range
    • reverseSort

      public static void reverseSort(byte[] a)
      Sorts the specified array of bytes in reverse order.
      Parameters:
      a - the array to be sorted
    • reverseSort

      public static void reverseSort(byte[] a, int fromIndex, int toIndex) throws ArrayIndexOutOfBoundsException
      Sorts the specified range of the array of bytes in reverse order.
      Parameters:
      a - the array to be sorted
      fromIndex - the index of the first element (inclusive) to be sorted
      toIndex - the index of the last element (exclusive) to be sorted
      Throws:
      ArrayIndexOutOfBoundsException - if fromIndex or toIndex is out of range
    • reverseSort

      public static void reverseSort(short[] a)
      Sorts the specified array of shorts in reverse order.
      Parameters:
      a - the array to be sorted
    • reverseSort

      public static void reverseSort(short[] a, int fromIndex, int toIndex) throws ArrayIndexOutOfBoundsException
      Sorts the specified range of the array of shorts in reverse order.
      Parameters:
      a - the array to be sorted
      fromIndex - the index of the first element (inclusive) to be sorted
      toIndex - the index of the last element (exclusive) to be sorted
      Throws:
      ArrayIndexOutOfBoundsException - if fromIndex or toIndex is out of range
    • reverseSort

      public static void reverseSort(int[] a)
      Sorts the specified array of ints in reverse order.
      Parameters:
      a - the array to be sorted
    • reverseSort

      public static void reverseSort(int[] a, int fromIndex, int toIndex) throws ArrayIndexOutOfBoundsException
      Sorts the specified range of the array of ints in reverse order.
      Parameters:
      a - the array to be sorted
      fromIndex - the index of the first element (inclusive) to be sorted
      toIndex - the index of the last element (exclusive) to be sorted
      Throws:
      ArrayIndexOutOfBoundsException - if fromIndex or toIndex is out of range
    • reverseSort

      public static void reverseSort(long[] a)
      Sorts the specified array of longs in reverse order.
      Parameters:
      a - the array to be sorted
    • reverseSort

      public static void reverseSort(long[] a, int fromIndex, int toIndex) throws ArrayIndexOutOfBoundsException
      Sorts the specified range of the array of longs in reverse order.
      Parameters:
      a - the array to be sorted
      fromIndex - the index of the first element (inclusive) to be sorted
      toIndex - the index of the last element (exclusive) to be sorted
      Throws:
      ArrayIndexOutOfBoundsException - if fromIndex or toIndex is out of range
    • reverseSort

      public static void reverseSort(float[] a)
      Sorts the specified array of floats in reverse order.
      Parameters:
      a - the array to be sorted
    • reverseSort

      public static void reverseSort(float[] a, int fromIndex, int toIndex) throws ArrayIndexOutOfBoundsException
      Sorts the specified range of the array of floats in reverse order.
      Parameters:
      a - the array to be sorted
      fromIndex - the index of the first element (inclusive) to be sorted
      toIndex - the index of the last element (exclusive) to be sorted
      Throws:
      ArrayIndexOutOfBoundsException - if fromIndex or toIndex is out of range
    • reverseSort

      public static void reverseSort(double[] a)
      Sorts the specified array of doubles in reverse order.
      Parameters:
      a - the array to be sorted
    • reverseSort

      public static void reverseSort(double[] a, int fromIndex, int toIndex) throws ArrayIndexOutOfBoundsException
      Sorts the specified range of the array of doubles in reverse order.
      Parameters:
      a - the array to be sorted
      fromIndex - the index of the first element (inclusive) to be sorted
      toIndex - the index of the last element (exclusive) to be sorted
      Throws:
      ArrayIndexOutOfBoundsException - if fromIndex or toIndex is out of range
    • reverseSort

      public static void reverseSort(Object[] a)
      Sorts the specified array of objects in reverse order. (where null is maximum)
      Parameters:
      a - the array to be sorted
    • reverseSort

      public static void reverseSort(Object[] a, int fromIndex, int toIndex) throws ArrayIndexOutOfBoundsException
      Sorts the specified range of the array of objects in reverse order. (where null is maximum)
      Parameters:
      a - the array to be sorted
      fromIndex - the index of the first element (inclusive) to be sorted
      toIndex - the index of the last element (exclusive) to be sorted
      Throws:
      ArrayIndexOutOfBoundsException - if fromIndex or toIndex is out of range
    • reverseSort

      public static <T extends Comparable<? super T>> void reverseSort(List<? extends T> list)
      Sorts the specified list in reverse order. (where null is maximum)
      Type Parameters:
      T -
      Parameters:
      list - the list to be sorted
    • reverseSort

      public static <T extends Comparable<? super T>> void reverseSort(List<? extends T> list, int fromIndex, int toIndex) throws ArrayIndexOutOfBoundsException
      Sorts the specified range of the list in reverse order. (where null is maximum)
      Type Parameters:
      T -
      Parameters:
      list - the list to be sorted
      fromIndex - the index of the first element (inclusive) to be sorted
      toIndex - the index of the last element (exclusive) to be sorted
      Throws:
      ArrayIndexOutOfBoundsException - if fromIndex or toIndex is out of range
    • reverseSortBy

      public static <T, U extends Comparable<? super U>> void reverseSortBy(T[] a, Function<? super T,? extends U> keyExtractor)
      Sorts the specified array based on the keys extracted by the provided Function in reverse order.
      Type Parameters:
      T - the type of elements in the array
      U - the type of keys extracted from the elements, which must be comparable
      Parameters:
      a - the array to be sorted
      keyExtractor - the function to extract the keys from the elements
    • reverseSortBy

      public static <T, U extends Comparable<? super U>> void reverseSortBy(List<? extends T> list, Function<? super T,? extends U> keyExtractor)
      Sorts the specified list based on the keys extracted by the provided Function in reverse order.
      Type Parameters:
      T - the type of elements in the list
      U - the type of keys extracted from the elements, which must be comparable
      Parameters:
      list - the list to be sorted
      keyExtractor - the function to extract the keys from the elements
    • reverseSortByInt

      public static <T> void reverseSortByInt(T[] a, ToIntFunction<? super T> keyExtractor)
      Sorts the specified array based on the int values extracted by the provided ToIntFunction in reverse order.
      Type Parameters:
      T - the type of elements in the array
      Parameters:
      a - the array to be sorted
      keyExtractor - the function to extract the int key from the elements
    • reverseSortByInt

      public static <T> void reverseSortByInt(List<? extends T> list, ToIntFunction<? super T> keyExtractor)
      Sorts the specified list based on the int values extracted by the provided ToIntFunction in reverse order.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      list - the list to be sorted
      keyExtractor - the function to extract the int key from the elements
    • reverseSortByLong

      public static <T> void reverseSortByLong(T[] a, ToLongFunction<? super T> keyExtractor)
      Sorts the specified array based on the long values extracted by the provided ToLongFunction in reverse order.
      Type Parameters:
      T - the type of elements in the array
      Parameters:
      a - the array to be sorted
      keyExtractor - the function to extract the long key from the elements
    • reverseSortByLong

      public static <T> void reverseSortByLong(List<? extends T> list, ToLongFunction<? super T> keyExtractor)
      Sorts the specified list based on the long values extracted by the provided ToLongFunction in reverse order.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      list - the list to be sorted
      keyExtractor - the function to extract the long key from the elements
    • reverseSortByFloat

      public static <T> void reverseSortByFloat(T[] a, ToFloatFunction<? super T> keyExtractor)
      Sorts the specified array based on the float values extracted by the provided ToFloatFunction in reverse order.
      Type Parameters:
      T - the type of elements in the array
      Parameters:
      a - the array to be sorted
      keyExtractor - the function to extract the float key from the elements
    • reverseSortByFloat

      public static <T> void reverseSortByFloat(List<? extends T> list, ToFloatFunction<? super T> keyExtractor)
      Sorts the specified list based on the float values extracted by the provided ToFloatFunction in reverse order.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      list - the list to be sorted
      keyExtractor - the function to extract the float key from the elements
    • reverseSortByDouble

      public static <T> void reverseSortByDouble(T[] a, ToDoubleFunction<? super T> keyExtractor)
      Sorts the specified array based on the double values extracted by the provided ToDoubleFunction in reverse order.
      Type Parameters:
      T - the type of elements in the array
      Parameters:
      a - the array to be sorted
      keyExtractor - the function to extract the double key from the elements
    • reverseSortByDouble

      public static <T> void reverseSortByDouble(List<? extends T> list, ToDoubleFunction<? super T> keyExtractor) throws IndexOutOfBoundsException
      Sorts the specified list based on the double values extracted by the provided ToDoubleFunction in reverse order.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      list - the list to be sorted
      keyExtractor - the function to extract the double key from the elements
      Throws:
      IndexOutOfBoundsException
    • binarySearch

      public static int binarySearch(char[] a, char valueToFind)
      Performs a binary search on the specified array of characters to find the specified value. The array must be sorted (as by the sort(char[]) method) prior to making this call. If it is not sorted, the results are undefined. If the array contains multiple elements with the specified value, there is no guarantee which one will be found.
      Parameters:
      a - the array to be searched. It must be sorted in ascending order
      valueToFind - the value to be searched for
      Returns:
      the index of the value to be searched, if it is contained in the array within the specified range; otherwise, (-(insertion point) - 1), or -1 if the array is null or empty.
      See Also:
    • binarySearch

      public static int binarySearch(char[] a, int fromIndex, int toIndex, char valueToFind)
      Performs a binary search on the specified range of the array of characters to find the specified value. The range must be sorted (as by the sort(char[], int, int) method) prior to making this call. If it is not sorted, the results are undefined. If the range contains multiple elements with the specified value, there is no guarantee which one will be found.
      Parameters:
      a - the array to be searched. It must be sorted in ascending order.
      fromIndex - the index of the first element (inclusive) to be searched.
      toIndex - the index of the last element (exclusive) to be searched.
      valueToFind - the value to be searched for.
      Returns:
      the index of the value to be searched, if it is contained in the array within the specified range; otherwise, (-(insertion point) - 1), or -1 if the array is null or empty.
      Throws:
      IndexOutOfBoundsException - if the range is out of bounds.
      See Also:
    • binarySearch

      public static int binarySearch(byte[] a, byte valueToFind)
      Performs a binary search on the specified array of bytes to find the specified value. The array must be sorted (as by the sort(byte[]) method) prior to making this call. If it is not sorted, the results are undefined. If the array contains multiple elements with the specified value, there is no guarantee which one will be found.
      Parameters:
      a - the array to be searched. It must be sorted in ascending order
      valueToFind - the value to be searched for
      Returns:
      the index of the value to be searched, if it is contained in the array within the specified range; otherwise, (-(insertion point) - 1), or -1 if the array is null or empty.
      See Also:
    • binarySearch

      public static int binarySearch(byte[] a, int fromIndex, int toIndex, byte valueToFind)
      Performs a binary search on the specified range of the array of bytes to find the specified value. The range must be sorted (as by the sort(byte[], int, int) method) prior to making this call. If it is not sorted, the results are undefined. If the range contains multiple elements with the specified value, there is no guarantee which one will be found.
      Parameters:
      a - the array to be searched. It must be sorted in ascending order.
      fromIndex - the index of the first element (inclusive) to be searched.
      toIndex - the index of the last element (exclusive) to be searched.
      valueToFind - the value to be searched for.
      Returns:
      the index of the value to be searched, if it is contained in the array within the specified range; otherwise, (-(insertion point) - 1), or -1 if the array is null or empty.
      Throws:
      IndexOutOfBoundsException - if the range is out of bounds.
      See Also:
    • binarySearch

      public static int binarySearch(short[] a, short valueToFind)
      Performs a binary search on the specified array of shorts to find the specified value. The array must be sorted (as by the sort(short[]) method) prior to making this call. If it is not sorted, the results are undefined. If the array contains multiple elements with the specified value, there is no guarantee which one will be found.
      Parameters:
      a - the array to be searched. It must be sorted in ascending order
      valueToFind - the value to be searched for
      Returns:
      the index of the value to be searched, if it is contained in the array within the specified range; otherwise, (-(insertion point) - 1), or -1 if the array is null or empty.
      See Also:
    • binarySearch

      public static int binarySearch(short[] a, int fromIndex, int toIndex, short valueToFind)
      Performs a binary search on the specified range of the array of shorts to find the specified value. The range must be sorted (as by the sort(short[], int, int) method) prior to making this call. If it is not sorted, the results are undefined. If the range contains multiple elements with the specified value, there is no guarantee which one will be found.
      Parameters:
      a - the array to be searched. It must be sorted in ascending order.
      fromIndex - the index of the first element (inclusive) to be searched.
      toIndex - the index of the last element (exclusive) to be searched.
      valueToFind - the value to be searched for.
      Returns:
      the index of the value to be searched, if it is contained in the array within the specified range; otherwise, (-(insertion point) - 1), or -1 if the array is null or empty.
      Throws:
      IndexOutOfBoundsException - if the range is out of bounds.
      See Also:
    • binarySearch

      public static int binarySearch(int[] a, int valueToFind)
      Performs a binary search on the specified array of ints to find the specified value. The array must be sorted (as by the sort(int[]) method) prior to making this call. If it is not sorted, the results are undefined. If the array contains multiple elements with the specified value, there is no guarantee which one will be found.
      Parameters:
      a - the array to be searched. It must be sorted in ascending order
      valueToFind - the value to be searched for
      Returns:
      the index of the value to be searched, if it is contained in the array within the specified range; otherwise, (-(insertion point) - 1), or -1 if the array is null or empty.
      See Also:
    • binarySearch

      public static int binarySearch(int[] a, int fromIndex, int toIndex, int valueToFind)
      Performs a binary search on the specified range of the array of ints to find the specified value. The range must be sorted (as by the sort(int[], int, int) method) prior to making this call. If it is not sorted, the results are undefined. If the range contains multiple elements with the specified value, there is no guarantee which one will be found.
      Parameters:
      a - the array to be searched. It must be sorted in ascending order.
      fromIndex - the index of the first element (inclusive) to be searched.
      toIndex - the index of the last element (exclusive) to be searched.
      valueToFind - the value to be searched for.
      Returns:
      the index of the value to be searched, if it is contained in the array within the specified range; otherwise, (-(insertion point) - 1), or -1 if the array is null or empty.
      Throws:
      IndexOutOfBoundsException - if the range is out of bounds.
      See Also:
    • binarySearch

      public static int binarySearch(long[] a, long valueToFind)
      Performs a binary search on the specified array of longs to find the specified value. The array must be sorted (as by the sort(long[]) method) prior to making this call. If it is not sorted, the results are undefined. If the array contains multiple elements with the specified value, there is no guarantee which one will be found.
      Parameters:
      a - the array to be searched. It must be sorted in ascending order
      valueToFind - the value to be searched for
      Returns:
      the index of the value to be searched, if it is contained in the array within the specified range; otherwise, (-(insertion point) - 1), or -1 if the array is null or empty.
      See Also:
    • binarySearch

      public static int binarySearch(long[] a, int fromIndex, int toIndex, long valueToFind)
      Performs a binary search on the specified range of the array of longs to find the specified value. The range must be sorted (as by the sort(long[], int, int) method) prior to making this call. If it is not sorted, the results are undefined. If the range contains multiple elements with the specified value, there is no guarantee which one will be found.
      Parameters:
      a - the array to be searched. It must be sorted in ascending order.
      fromIndex - the index of the first element (inclusive) to be searched.
      toIndex - the index of the last element (exclusive) to be searched.
      valueToFind - the value to be searched for.
      Returns:
      the index of the value to be searched, if it is contained in the array within the specified range; otherwise, (-(insertion point) - 1), or -1 if the array is null or empty.
      Throws:
      IndexOutOfBoundsException - if the range is out of bounds.
      See Also:
    • binarySearch

      public static int binarySearch(float[] a, float valueToFind)
      Performs a binary search on the specified array of floats to find the specified value. The array must be sorted (as by the sort(float[]) method) prior to making this call. If it is not sorted, the results are undefined. If the array contains multiple elements with the specified value, there is no guarantee which one will be found.
      Parameters:
      a - the array to be searched. It must be sorted in ascending order
      valueToFind - the value to be searched for
      Returns:
      the index of the value to be searched, if it is contained in the array within the specified range; otherwise, (-(insertion point) - 1), or -1 if the array is null or empty.
      See Also:
    • binarySearch

      public static int binarySearch(float[] a, int fromIndex, int toIndex, float valueToFind)
      Performs a binary search on the specified range of the array of floats to find the specified value. The range must be sorted (as by the sort(float[], int, int) method) prior to making this call. If it is not sorted, the results are undefined. If the range contains multiple elements with the specified value, there is no guarantee which one will be found.
      Parameters:
      a - the array to be searched. It must be sorted in ascending order.
      fromIndex - the index of the first element (inclusive) to be searched.
      toIndex - the index of the last element (exclusive) to be searched.
      valueToFind - the value to be searched for.
      Returns:
      the index of the value to be searched, if it is contained in the array within the specified range; otherwise, (-(insertion point) - 1), or -1 if the array is null or empty.
      Throws:
      IndexOutOfBoundsException - if the range is out of bounds.
      See Also:
    • binarySearch

      public static int binarySearch(double[] a, double valueToFind)
      Performs a binary search on the specified array of doubles to find the specified value. The array must be sorted (as by the sort(double[]) method) prior to making this call. If it is not sorted, the results are undefined. If the array contains multiple elements with the specified value, there is no guarantee which one will be found.
      Parameters:
      a - the array to be searched. It must be sorted in ascending order
      valueToFind - the value to be searched for
      Returns:
      the index of the value to be searched, if it is contained in the array within the specified range; otherwise, (-(insertion point) - 1), or -1 if the array is null or empty.
      See Also:
    • binarySearch

      public static int binarySearch(double[] a, int fromIndex, int toIndex, double valueToFind)
      Performs a binary search on the specified range of the array of doubles to find the specified value. The range must be sorted (as by the sort(double[], int, int) method) prior to making this call. If it is not sorted, the results are undefined. If the range contains multiple elements with the specified value, there is no guarantee which one will be found.
      Parameters:
      a - the array to be searched. It must be sorted in ascending order.
      fromIndex - the index of the first element (inclusive) to be searched.
      toIndex - the index of the last element (exclusive) to be searched.
      valueToFind - the value to be searched for.
      Returns:
      the index of the value to be searched, if it is contained in the array within the specified range; otherwise, (-(insertion point) - 1), or -1 if the array is null or empty.
      Throws:
      IndexOutOfBoundsException - if the range is out of bounds.
      See Also:
    • binarySearch

      public static int binarySearch(Object[] a, Object valueToFind)
      Performs a binary search on the specified array of objects to find the specified value. The array must be sorted (as by the sort(Object[]) method) prior to making this call. If it is not sorted, the results are undefined. If the array contains multiple elements with the specified value, there is no guarantee which one will be found.
      Parameters:
      a - the array to be searched. It must be sorted in ascending order
      valueToFind - the value to be searched for
      Returns:
      the index of the value to be searched, if it is contained in the array within the specified range; otherwise, (-(insertion point) - 1), or -1 if the array is null or empty.
      See Also:
    • binarySearch

      public static int binarySearch(Object[] a, int fromIndex, int toIndex, Object valueToFind)
      Performs a binary search on the specified range of the array of objects to find the specified value. The range must be sorted (as by the sort(Object[], int, int) method) prior to making this call. If it is not sorted, the results are undefined. If the range contains multiple elements with the specified value, there is no guarantee which one will be found.
      Parameters:
      a - the array to be searched. It must be sorted in ascending order.
      fromIndex - the index of the first element (inclusive) to be searched.
      toIndex - the index of the last element (exclusive) to be searched.
      valueToFind - the value to be searched for.
      Returns:
      the index of the value to be searched, if it is contained in the array within the specified range; otherwise, (-(insertion point) - 1), or -1 if the array is null or empty.
      Throws:
      IndexOutOfBoundsException - if the range is out of bounds.
      See Also:
    • binarySearch

      public static <T> int binarySearch(T[] a, T valueToFind, Comparator<? super T> cmp)
      Performs a binary search on the specified array of objects to find the specified value. The array must be sorted (as by the sort(Object[], Comparator) method) prior to making this call. If it is not sorted, the results are undefined. If the array contains multiple elements with the specified value, there is no guarantee which one will be found.
      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the array to be searched. It must be sorted in ascending order
      valueToFind - the value to be searched for
      cmp - the comparator by which the array is ordered
      Returns:
      the index of the value to be searched, if it is contained in the array within the specified range; otherwise, (-(insertion point) - 1), or -1 if the array is null or empty.
      See Also:
    • binarySearch

      public static <T> int binarySearch(T[] a, int fromIndex, int toIndex, T valueToFind, Comparator<? super T> cmp)
      Performs a binary search on the specified range of the array of objects to find the specified value. The range must be sorted (as by the sort(Object[], int, int, Comparator) method) prior to making this call. If it is not sorted, the results are undefined. If the range contains multiple elements with the specified value, there is no guarantee which one will be found.
      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the array to be searched. It must be sorted in ascending order.
      fromIndex - the index of the first element (inclusive) to be searched.
      toIndex - the index of the last element (exclusive) to be searched.
      valueToFind - the value to be searched for.
      cmp - the comparator by which the array is ordered
      Returns:
      the index of the value to be searched, if it is contained in the array within the specified range; otherwise, (-(insertion point) - 1), or -1 if the array is null or empty.
      Throws:
      IndexOutOfBoundsException - if the range is out of bounds.
      See Also:
    • binarySearch

      public static <T extends Comparable<? super T>> int binarySearch(List<? extends T> list, T valueToFind)
      Performs a binary search on the specified list of objects to find the specified value. The list must be sorted (as by the sort(List) method) prior to making this call. If it is not sorted, the results are undefined. If the list contains multiple elements with the specified value, there is no guarantee which one will be found.
      Type Parameters:
      T - the type of the elements in the list
      Parameters:
      list - the list to be searched. It must be sorted in ascending order
      valueToFind - the value to be searched for
      Returns:
      the index of the value to be searched, if it is contained in the list within the specified range; otherwise, (-(insertion point) - 1), or -1 if the list is null or empty.
      See Also:
    • binarySearch

      public static <T extends Comparable<? super T>> int binarySearch(List<? extends T> list, int fromIndex, int toIndex, T valueToFind)
      Performs a binary search on the specified range of the list of objects to find the specified value. The range must be sorted (as by the sort(List, int, int) method) prior to making this call. If it is not sorted, the results are undefined. If the range contains multiple elements with the specified value, there is no guarantee which one will be found.
      Type Parameters:
      T - the type of the elements in the list
      Parameters:
      list - the list to be searched. It must be sorted in ascending order.
      fromIndex - the index of the first element (inclusive) to be searched.
      toIndex - the index of the last element (exclusive) to be searched.
      valueToFind - the value to be searched for.
      Returns:
      the index of the value to be searched, if it is contained in the list within the specified range; otherwise, (-(insertion point) - 1), or -1 if the list is null or empty.
      Throws:
      IndexOutOfBoundsException - if the range is out of bounds.
      See Also:
    • binarySearch

      public static <T> int binarySearch(List<? extends T> list, T valueToFind, Comparator<? super T> cmp)
      Performs a binary search on the specified list of objects to find the specified value. The list must be sorted (as by the sort(List, Comparator) method) prior to making this call. If it is not sorted, the results are undefined. If the list contains multiple elements with the specified value, there is no guarantee which one will be found.
      Type Parameters:
      T - the type of the elements in the list
      Parameters:
      list - the list to be searched. It must be sorted in ascending order
      valueToFind - the value to be searched for
      cmp - the comparator by which the list is ordered
      Returns:
      the index of the value to be searched, if it is contained in the list within the specified range; otherwise, (-(insertion point) - 1), or -1 if the list is null or empty.
      See Also:
    • binarySearch

      public static <T> int binarySearch(List<? extends T> list, int fromIndex, int toIndex, T valueToFind, Comparator<? super T> cmp)
      Performs a binary search on the specified range of the list of objects to find the specified value. The range must be sorted (as by the sort(List, int, int, Comparator) method) prior to making this call. If it is not sorted, the results are undefined. If the range contains multiple elements with the specified value, there is no guarantee which one will be found.
      Type Parameters:
      T - the type of the elements in the list
      Parameters:
      list - the list to be searched. It must be sorted in ascending order.
      fromIndex - the index of the first element (inclusive) to be searched.
      toIndex - the index of the last element (exclusive) to be searched.
      valueToFind - the value to be searched for.
      cmp - the comparator by which the list is ordered
      Returns:
      the index of the value to be searched, if it is contained in the list within the specified range; otherwise, (-(insertion point) - 1), or -1 if the list is null or empty.
      Throws:
      IndexOutOfBoundsException - if the range is out of bounds.
      See Also:
    • indexOf

      public static int indexOf(boolean[] a, boolean valueToFind)
      Returns the index of the first occurrence of the specified value in the array.
      Parameters:
      a - the array to be searched
      valueToFind - the value to be searched for
      Returns:
      the index of the first occurrence of the specified value in the array, or -1 if the array is null or empty or does not contain the value
    • indexOf

      public static int indexOf(boolean[] a, boolean valueToFind, int fromIndex)
      Returns the index of the first occurrence of the specified value in the array, starting the search at the specified index.
      Parameters:
      a - the array to be searched
      valueToFind - the value to be searched for
      fromIndex - the index to start the search from
      Returns:
      the index of the first occurrence of the specified value in the array, or -1 if the array is null or empty or does not contain the value
    • indexOf

      public static int indexOf(char[] a, char valueToFind)
      Returns the index of the first occurrence of the specified value in the array.
      Parameters:
      a - the array to be searched
      valueToFind - the value to be searched for
      Returns:
      the index of the first occurrence of the specified value in the array, or -1 if the array is null or empty or does not contain the value
    • indexOf

      public static int indexOf(char[] a, char valueToFind, int fromIndex)
      Returns the index of the first occurrence of the specified value in the array, starting the search at the specified index.
      Parameters:
      a - the array to be searched
      valueToFind - the value to be searched for
      fromIndex - the index to start the search from
      Returns:
      the index of the first occurrence of the specified value in the array, or -1 if the array is null or empty or does not contain the value
    • indexOf

      public static int indexOf(byte[] a, byte valueToFind)
      Returns the index of the first occurrence of the specified value in the array.
      Parameters:
      a - the array to be searched
      valueToFind - the value to be searched for
      Returns:
      the index of the first occurrence of the specified value in the array, or -1 if the array is null or empty or does not contain the value
    • indexOf

      public static int indexOf(byte[] a, byte valueToFind, int fromIndex)
      Returns the index of the first occurrence of the specified value in the array, starting the search at the specified index.
      Parameters:
      a - the array to be searched
      valueToFind - the value to be searched for
      fromIndex - the index to start the search from
      Returns:
      the index of the first occurrence of the specified value in the array, or -1 if the array is null or empty or does not contain the value
    • indexOf

      public static int indexOf(short[] a, short valueToFind)
      Returns the index of the first occurrence of the specified value in the array.
      Parameters:
      a - the array to be searched
      valueToFind - the value to be searched for
      Returns:
      the index of the first occurrence of the specified value in the array, or -1 if the array is null or empty or does not contain the value
    • indexOf

      public static int indexOf(short[] a, short valueToFind, int fromIndex)
      Returns the index of the first occurrence of the specified value in the array, starting the search at the specified index.
      Parameters:
      a - the array to be searched
      valueToFind - the value to be searched for
      fromIndex - the index to start the search from
      Returns:
      the index of the first occurrence of the specified value in the array, or -1 if the array is null or empty or does not contain the value
    • indexOf

      public static int indexOf(int[] a, int valueToFind)
      Returns the index of the first occurrence of the specified value in the array.
      Parameters:
      a - the array to be searched
      valueToFind - the value to be searched for
      Returns:
      the index of the first occurrence of the specified value in the array, or -1 if the array is null or empty or does not contain the value
    • indexOf

      public static int indexOf(int[] a, int valueToFind, int fromIndex)
      Returns the index of the first occurrence of the specified value in the array, starting the search at the specified index.
      Parameters:
      a - the array to be searched
      valueToFind - the value to be searched for
      fromIndex - the index to start the search from
      Returns:
      the index of the first occurrence of the specified value in the array, or -1 if the array is null or empty or does not contain the value
    • indexOf

      public static int indexOf(long[] a, long valueToFind)
      Returns the index of the first occurrence of the specified value in the array.
      Parameters:
      a - the array to be searched
      valueToFind - the value to be searched for
      Returns:
      the index of the first occurrence of the specified value in the array, or -1 if the array is null or empty or does not contain the value
    • indexOf

      public static int indexOf(long[] a, long valueToFind, int fromIndex)
      Returns the index of the first occurrence of the specified value in the array, starting the search at the specified index.
      Parameters:
      a - the array to be searched
      valueToFind - the value to be searched for
      fromIndex - the index to start the search from
      Returns:
      the index of the first occurrence of the specified value in the array, or -1 if the array is null or empty or does not contain the value
    • indexOf

      public static int indexOf(float[] a, float valueToFind)
      Returns the index of the first occurrence of the specified value in the array.
      Parameters:
      a - the array to be searched
      valueToFind - the value to be searched for
      Returns:
      the index of the first occurrence of the specified value in the array, or -1 if the array is null or empty or does not contain the value
    • indexOf

      public static int indexOf(float[] a, float valueToFind, int fromIndex)
      Returns the index of the first occurrence of the specified value in the array, starting the search at the specified index.
      Parameters:
      a - the array to be searched
      valueToFind - the value to be searched for
      fromIndex - the index to start the search from
      Returns:
      the index of the first occurrence of the specified value in the array, or -1 if the array is null or empty or does not contain the value
    • indexOf

      public static int indexOf(double[] a, double valueToFind)
      Returns the index of the first occurrence of the specified value in the array.
      Parameters:
      a - the array to be searched
      valueToFind - the value to be searched for
      Returns:
      the index of the first occurrence of the specified value in the array, or -1 if the array is null or empty or does not contain the value
    • indexOf

      public static int indexOf(double[] a, double valueToFind, int fromIndex)
      Returns the index of the first occurrence of the specified value in the array, starting the search at the specified index.
      Parameters:
      a - the array to be searched
      valueToFind - the value to be searched for
      fromIndex - the index to start the search from
      Returns:
      the index of the first occurrence of the specified value in the array, or -1 if the array is null or empty or does not contain the value
    • indexOf

      public static int indexOf(double[] a, double valueToFind, double tolerance)

      Finds the index of the given value within a given tolerance in the array. This method will return the index of the first value which falls between the region defined by valueToFind - tolerance and valueToFind + tolerance.

      This method returns INDEX_NOT_FOUND (-1) for a null input array.

      Parameters:
      a - the array to search through for the object, may be null
      valueToFind -
      tolerance - tolerance of the search
      Returns:
      the index of the value within the array, INDEX_NOT_FOUND (-1) if not found or null array input
    • indexOf

      public static int indexOf(double[] a, double valueToFind, double tolerance, int fromIndex)

      Finds the index of the given value in the array starting at the given index. This method will return the index of the first value which falls between the region defined by valueToFind - tolerance and valueToFind + tolerance.

      This method returns INDEX_NOT_FOUND (-1) for a null input array.

      A negative startIndex is treated as zero. A startIndex larger than the array length will return INDEX_NOT_FOUND (-1).

      Parameters:
      a - the array to search through for the object, may be null
      valueToFind -
      tolerance - tolerance of the search
      fromIndex - the index to start searching at
      Returns:
      the index of the value within the array, INDEX_NOT_FOUND (-1) if not found or null array input
    • indexOf

      public static int indexOf(Object[] a, Object valueToFind)
      Returns the index of the first occurrence of the specified value in the array.
      Parameters:
      a - the array to be searched
      valueToFind - the value to be searched for
      Returns:
      the index of the first occurrence of the specified value in the array, or -1 if the array is null or empty or does not contain the value
    • indexOf

      public static int indexOf(Object[] a, Object valueToFind, int fromIndex)
      Returns the index of the first occurrence of the specified value in the array, starting the search at the specified index.
      Parameters:
      a - the array to be searched
      valueToFind - the value to be searched for
      fromIndex - the index to start the search from
      Returns:
      the index of the first occurrence of the specified value in the array, or -1 if the array is null or empty or does not contain
    • indexOf

      public static int indexOf(Collection<?> c, Object valueToFind)
      Returns the index of the first occurrence of the specified value in the specified collection.
      Parameters:
      valueToFind - the value to be searched for
      a - the collection to be searched
      Returns:
      the index of the first occurrence of the specified value in the collection, or -1 if the collection is null or empty or does not contain the value
    • indexOf

      public static int indexOf(Collection<?> c, Object valueToFind, int fromIndex)
      Returns the index of the first occurrence of the specified value in the specified collection, starting the search at the specified index.
      Parameters:
      valueToFind - the value to be searched for
      fromIndex - the index to start the search from
      a - the collection to be searched
      Returns:
      the index of the first occurrence of the specified value in the collection, or -1 if the collection is null or empty or does not contain the value
    • indexOf

      public static int indexOf(Iterator<?> iter, Object valueToFind) throws ArithmeticException
      Returns the index of the first occurrence of the specified value in the given iterator.
      Parameters:
      iter - The iterator to be searched.
      valueToFind - The value to find in the iterator.
      Returns:
      The index of the first occurrence of the specified value in the iterator, or -1 if the value is not found.
      Throws:
      ArithmeticException - If the found index overflows an int.
      See Also:
    • indexOf

      public static int indexOf(Iterator<?> iter, Object valueToFind, int fromIndex) throws ArithmeticException
      Returns the index of the first occurrence of the specified value in the given iterator, starting the search from the specified index.
      Parameters:
      iter - The iterator to be searched.
      valueToFind - The value to find in the iterator.
      fromIndex - The index to start the search from.
      Returns:
      The index of the first occurrence of the specified value in the iterator, or -1 if the value is not found.
      Throws:
      ArithmeticException - If the found index overflows an int.
      See Also:
      • invalid reference
        Iterators#indexOf(Iterator, Object, int)
    • indexOfSubList

      public static int indexOfSubList(List<?> sourceList, List<?> subListToFind)
      Returns the starting position of the first occurrence of the specified sublist within the source list.
      Parameters:
      sourceList - the list to search within
      subListToFind - the sublist to search for
      Returns:
      the starting position of the first occurrence of the specified sublist, or -1 if there is no such occurrence
      See Also:
    • indexOfSubList

      public static int indexOfSubList(List<?> sourceList, List<?> subListToFind, int fromIndex)
      Returns the starting position of the first occurrence of the specified sublist within the source list, starting the search at the specified index.
      Parameters:
      sourceList - the list to search within
      subListToFind - the sublist to search for
      fromIndex - the index to start the search from
      Returns:
      the starting position of the first occurrence of the specified sublist, or -1 if there is no such occurrence
      Throws:
      IndexOutOfBoundsException - if the starting index is out of range
      See Also:
    • indexOfIgnoreCase

      public static int indexOfIgnoreCase(String[] a, String valueToFind)
      Returns the index of the first occurrence of the specified string in the array, ignoring case considerations.
      Parameters:
      a - the array to search within
      valueToFind - the string to search for
      Returns:
      the index of the first occurrence of the specified string, or -1 if there is no such occurrence
    • indexOfIgnoreCase

      public static int indexOfIgnoreCase(String[] a, String valueToFind, int fromIndex)
      Returns the index of the first occurrence of the specified string in the array, ignoring case considerations, starting the search at the specified index.
      Parameters:
      a - the array to search within
      valueToFind - the string to search for
      fromIndex - the index to start the search from
      Returns:
      the index of the first occurrence of the specified string, or -1 if there is no such occurrence
    • lastIndexOf

      public static int lastIndexOf(boolean[] a, boolean valueToFind)
      Returns the index of the last occurrence of the specified value in the array.
      Parameters:
      a - the array to search within
      valueToFind - the value to search for
      Returns:
      the index of the last occurrence of the specified value, or -1 if there is no such occurrence
    • lastIndexOf

      public static int lastIndexOf(boolean[] a, boolean valueToFind, int startIndexFromBack)
      Returns the index of the last occurrence of the specified value in the array, starting the search backwards from the specified index.
      Parameters:
      a - the array to search within
      valueToFind - the value to search for
      startIndexFromBack - the index to start the search from
      Returns:
      the index of the last occurrence of the specified value, or -1 if there is no such occurrence
    • lastIndexOf

      public static int lastIndexOf(char[] a, char valueToFind)
      Returns the index of the last occurrence of the specified value in the array.
      Parameters:
      a - the array to search within
      valueToFind - the value to search for
      Returns:
      the index of the last occurrence of the specified value, or -1 if there is no such occurrence
    • lastIndexOf

      public static int lastIndexOf(char[] a, char valueToFind, int startIndexFromBack)
      Returns the index of the last occurrence of the specified value in the array, starting the search backwards from the specified index.
      Parameters:
      a - the array to search within
      valueToFind - the value to search for
      startIndexFromBack - the index to start the search from
      Returns:
      the index of the last occurrence of the specified value, or -1 if there is no such occurrence
    • lastIndexOf

      public static int lastIndexOf(byte[] a, byte valueToFind)
      Returns the index of the last occurrence of the specified value in the array.
      Parameters:
      a - the array to search within
      valueToFind - the value to search for
      Returns:
      the index of the last occurrence of the specified value, or -1 if there is no such occurrence
    • lastIndexOf

      public static int lastIndexOf(byte[] a, byte valueToFind, int startIndexFromBack)
      Returns the index of the last occurrence of the specified value in the array, starting the search backwards from the specified index.
      Parameters:
      a - the array to search within
      valueToFind - the value to search for
      startIndexFromBack - the index to start the search from
      Returns:
      the index of the last occurrence of the specified value, or -1 if there is no such occurrence
    • lastIndexOf

      public static int lastIndexOf(short[] a, short valueToFind)
      Returns the index of the last occurrence of the specified value in the array.
      Parameters:
      a - the array to search within
      valueToFind - the value to search for
      Returns:
      the index of the last occurrence of the specified value, or -1 if there is no such occurrence
    • lastIndexOf

      public static int lastIndexOf(short[] a, short valueToFind, int startIndexFromBack)
      Returns the index of the last occurrence of the specified value in the array, starting the search backwards from the specified index.
      Parameters:
      a - the array to search within
      valueToFind - the value to search for
      startIndexFromBack - the index to start the search from
      Returns:
      the index of the last occurrence of the specified value, or -1 if there is no such occurrence
    • lastIndexOf

      public static int lastIndexOf(int[] a, int valueToFind)
      Returns the index of the last occurrence of the specified value in the array.
      Parameters:
      a - the array to search within
      valueToFind - the value to search for
      Returns:
      the index of the last occurrence of the specified value, or -1 if there is no such occurrence
    • lastIndexOf

      public static int lastIndexOf(int[] a, int valueToFind, int startIndexFromBack)
      Returns the index of the last occurrence of the specified value in the array, starting the search backwards from the specified index.
      Parameters:
      a - the array to search within
      valueToFind - the value to search for
      startIndexFromBack - the index to start the search from
      Returns:
      the index of the last occurrence of the specified value, or -1 if there is no such occurrence
    • lastIndexOf

      public static int lastIndexOf(long[] a, long valueToFind)
      Returns the index of the last occurrence of the specified value in the array.
      Parameters:
      a - the array to search within
      valueToFind - the value to search for
      Returns:
      the index of the last occurrence of the specified value, or -1 if there is no such occurrence
    • lastIndexOf

      public static int lastIndexOf(long[] a, long valueToFind, int startIndexFromBack)
      Returns the index of the last occurrence of the specified value in the array, starting the search backwards from the specified index.
      Parameters:
      a - the array to search within
      valueToFind - the value to search for
      startIndexFromBack - the index to start the search from
      Returns:
      the index of the last occurrence of the specified value, or -1 if there is no such occurrence
    • lastIndexOf

      public static int lastIndexOf(float[] a, float valueToFind)
      Returns the index of the last occurrence of the specified value in the array.
      Parameters:
      a - the array to search within
      valueToFind - the value to search for
      Returns:
      the index of the last occurrence of the specified value, or -1 if there is no such occurrence
    • lastIndexOf

      public static int lastIndexOf(float[] a, float valueToFind, int startIndexFromBack)
      Returns the index of the last occurrence of the specified value in the array, starting the search backwards from the specified index.
      Parameters:
      a - the array to search within
      valueToFind - the value to search for
      startIndexFromBack - the index to start the search from
      Returns:
      the index of the last occurrence of the specified value, or -1 if there is no such occurrence
    • lastIndexOf

      public static int lastIndexOf(double[] a, double valueToFind)
      Returns the index of the last occurrence of the specified value in the array.
      Parameters:
      a - the array to search within
      valueToFind - the value to search for
      Returns:
      the index of the last occurrence of the specified value, or -1 if there is no such occurrence
    • lastIndexOf

      public static int lastIndexOf(double[] a, double valueToFind, int startIndexFromBack)
      Returns the index of the last occurrence of the specified value in the array, starting the search backwards from the specified index.
      Parameters:
      a - the array to search within
      valueToFind - the value to search for
      startIndexFromBack - the index to start the search from
      Returns:
      the index of the last occurrence of the specified value, or -1 if there is no such occurrence
    • lastIndexOf

      public static int lastIndexOf(double[] a, double valueToFind, double tolerance)

      Finds the last index of the given value within a given tolerance in the array. This method will return the index of the last value which falls between the region defined by valueToFind - tolerance and valueToFind + tolerance.

      This method returns INDEX_NOT_FOUND (-1) for a null input array.

      Parameters:
      a - the array to search through for the object, may be null
      valueToFind -
      tolerance - tolerance of the search
      Returns:
      the index of the value within the array, INDEX_NOT_FOUND (-1) if not found or null array input
    • lastIndexOf

      public static int lastIndexOf(double[] a, double valueToFind, double tolerance, int startIndexFromBack)

      Finds the last index of the given value in the array starting at the given index. This method will return the index of the last value which falls between the region defined by valueToFind - tolerance and valueToFind + tolerance.

      This method returns INDEX_NOT_FOUND (-1) for a null input array.

      A negative startIndex will return INDEX_NOT_FOUND (-1). A startIndex larger than the array length will search from the end of the array.

      Parameters:
      a - the array to traverse for looking for the object, may be null
      valueToFind -
      tolerance - search for value within plus/minus this amount
      startIndexFromBack - the start index to traverse backwards from
      Returns:
      the last index of the value within the array, INDEX_NOT_FOUND (-1) if not found or null array input
    • lastIndexOf

      public static int lastIndexOf(Object[] a, Object valueToFind)
      Returns the index of the last occurrence of the specified value in the array.
      Parameters:
      a - the array to search within
      valueToFind - the value to search for
      Returns:
      the index of the last occurrence of the specified value, or -1 if there is no such occurrence
    • lastIndexOf

      public static int lastIndexOf(Object[] a, Object valueToFind, int startIndexFromBack)
      Returns the index of the last occurrence of the specified value in the array, starting the search backwards from the specified index.
      Parameters:
      a - the array to search within
      valueToFind - the value to search for
      startIndexFromBack - the index to start the search from
      Returns:
      the index of the last occurrence of the specified value, or -1 if there is no such occurrence
    • lastIndexOf

      public static int lastIndexOf(Collection<?> c, Object valueToFind)
      Returns the index of the last occurrence of the specified value in the specified collection.
      Parameters:
      c - the collection to search within
      valueToFind - the value to search for
      Returns:
      the index of the last occurrence of the specified value, or -1 if there is no such occurrence
    • lastIndexOf

      public static int lastIndexOf(Collection<?> c, Object valueToFind, int startIndexFromBack)
      Returns the index of the last occurrence of the specified value in the specified collection, starting the search backwards from the specified index.
      Parameters:
      c - the collection to search within
      valueToFind - the value to search for
      startIndexFromBack - the index to start the search from
      Returns:
      the index of the last occurrence of the specified value, or -1 if there is no such occurrence
    • lastIndexOfSubList

      public static int lastIndexOfSubList(List<?> sourceList, List<?> subListToFind)
      Returns the index of the last occurrence of the specified sublist in the source list.
      Parameters:
      sourceList - the list to search within
      subListToFind - the sublist to search for
      Returns:
      the index of the last occurrence of the specified sublist, or -1 if there is no such occurrence
    • lastIndexOfSubList

      public static int lastIndexOfSubList(List<?> sourceList, List<?> subListToFind, int startIndexFromBack)
      Returns the index of the last occurrence of the specified sublist in the source list, starting the search backwards from the specified index.
      Parameters:
      sourceList - the list to search within
      subListToFind - the sublist to search for
      startIndexFromBack - the index to start the search from.
      Returns:
      the index of the last occurrence of the specified sublist, or -1 if there is no such occurrence
      See Also:
    • lastIndexOfIgnoreCase

      public static int lastIndexOfIgnoreCase(String[] a, String valueToFind)
      Returns the index of the last occurrence of the specified string in the array, ignoring case considerations.
      Parameters:
      a - the array to search within
      valueToFind - the string to search for
      Returns:
      the index of the last occurrence of the specified string, or -1 if there is no such occurrence
    • lastIndexOfIgnoreCase

      public static int lastIndexOfIgnoreCase(String[] a, String valueToFind, int startIndexFromBack)
      Returns the index of the last occurrence of the specified string in the array, ignoring case considerations, starting the search backwards from the specified index.
      Parameters:
      a - the array to search within
      valueToFind - the string to search for
      startIndexFromBack - the index to start the search from
      Returns:
      the index of the last occurrence of the specified string, or -1 if there is no such occurrence
    • findFirstIndex

      public static <T> u.OptionalInt findFirstIndex(T[] a, Predicate<? super T> predicate)
      Finds the index of the first element in the array that matches the given predicate.
      Type Parameters:
      T - the type of elements in the array
      Parameters:
      a - the array to search within
      predicate - the predicate to apply to elements of the array
      Returns:
      an OptionalInt containing the index of the first matching element, or an empty OptionalInt if no match is found
    • findFirstIndex

      public static <T, U> u.OptionalInt findFirstIndex(T[] a, U u, BiPredicate<? super T,? super U> predicate)
      Finds the index of the first element in the array that matches the given predicate.
      Type Parameters:
      T - the type of elements in the array
      U - the type of the second argument to the predicate
      Parameters:
      a - the array to search within
      u - the second argument to the predicate
      predicate - the predicate to apply to elements of the array
      Returns:
      an OptionalInt containing the index of the first matching element, or an empty OptionalInt if no match is found
    • findFirstIndex

      public static <T> u.OptionalInt findFirstIndex(Collection<? extends T> c, Predicate<? super T> predicate)
      Finds the index of the first element in the collection that matches the given predicate.
      Type Parameters:
      T - the type of elements in the collection
      Parameters:
      c - the collection to search within
      predicate - the predicate to apply to elements of the collection
      Returns:
      an OptionalInt containing the index of the first matching element, or an empty OptionalInt if no match is found
    • findFirstIndex

      public static <T, U> u.OptionalInt findFirstIndex(Collection<? extends T> c, U u, BiPredicate<? super T,? super U> predicate)
      Finds the index of the first element in the collection that matches the given predicate.
      Type Parameters:
      T - the type of elements in the collection
      U - the type of the second argument to the predicate
      Parameters:
      c - the collection to search within
      u - the second argument to the predicate
      predicate - the predicate to apply to elements of the collection
      Returns:
      an OptionalInt containing the index of the first matching element, or an empty OptionalInt if no match is found
    • findLastIndex

      public static <T> u.OptionalInt findLastIndex(T[] a, Predicate<? super T> predicate)
      Finds the index of the last element in the array that matches the given predicate.
      Type Parameters:
      T - the type of elements in the array
      Parameters:
      a - the array to search within
      predicate - the predicate to apply to elements of the array
      Returns:
      an OptionalInt containing the index of the last matching element, or an empty OptionalInt if no match is found
    • findLastIndex

      public static <T, U> u.OptionalInt findLastIndex(T[] a, U u, BiPredicate<? super T,? super U> predicate)
      Finds the index of the last element in the array that matches the given predicate.
      Type Parameters:
      T - the type of elements in the array
      U - the type of the second argument to the predicate
      Parameters:
      a - the array to search within
      u - the second argument to the predicate
      predicate - the predicate to apply to elements of the array
      Returns:
      an OptionalInt containing the index of the last matching element, or an empty OptionalInt if no match is found
    • findLastIndex

      public static <T> u.OptionalInt findLastIndex(Collection<? extends T> c, Predicate<? super T> predicate)
      Finds the index of the last element in the collection that matches the given predicate.
      Type Parameters:
      T - the type of elements in the collection
      Parameters:
      c - the collection to search within
      predicate - the predicate to apply to elements of the collection
      Returns:
      an OptionalInt containing the index of the last matching element, or an empty OptionalInt if no match is found
    • findLastIndex

      public static <T, U> u.OptionalInt findLastIndex(Collection<? extends T> c, U u, BiPredicate<? super T,? super U> predicate)
      Finds the index of the last element in the collection that matches the given predicate.
      Type Parameters:
      T - the type of elements in the collection
      U - the type of the second argument to the predicate
      Parameters:
      c - the collection to search within
      u - the second argument to the predicate
      predicate - the predicate to apply to elements of the collection
      Returns:
      an OptionalInt containing the index of the last matching element, or an empty OptionalInt if no match is found
    • indicesOfAllMin

      public static <T extends Comparable<? super T>> int[] indicesOfAllMin(T[] a)
      Returns the indices of all minimum elements in the specified array.
      Type Parameters:
      T - the type of elements in the array
      Parameters:
      a - the array to search within
      Returns:
      an array of indices of all minimum elements. An empty array if the input array is empty.
    • indicesOfAllMin

      public static <T> int[] indicesOfAllMin(T[] a, Comparator<? super T> cmp)
      Returns the indices of all minimum elements in the specified array using the provided comparator.
      Type Parameters:
      T - the type of elements in the array
      Parameters:
      a - the array to search within
      cmp - the comparator to compare elements of the array
      Returns:
      an array of indices of all minimum elements. An empty array if the input array is empty.
    • indicesOfAllMin

      public static <T extends Comparable<? super T>> int[] indicesOfAllMin(Collection<? extends T> c) throws IllegalArgumentException
      Returns the indices of all minimum elements in the specified collection.
      Type Parameters:
      T - the type of elements in the collection
      Parameters:
      c - the collection to search within
      Returns:
      an array of indices of all minimum elements. An empty array if the input collection is empty.
      Throws:
      IllegalArgumentException
    • indicesOfAllMin

      public static <T> int[] indicesOfAllMin(Collection<? extends T> c, Comparator<? super T> cmp) throws IllegalArgumentException
      Returns the indices of all minimum elements in the specified collection using the provided comparator.
      Type Parameters:
      T - the type of elements in the collection
      Parameters:
      c - the collection to search within
      cmp - the comparator to compare elements of the collection
      Returns:
      an array of indices of all minimum elements. An empty array if the input collection is empty.
      Throws:
      IllegalArgumentException
    • indicesOfAllMax

      public static <T extends Comparable<? super T>> int[] indicesOfAllMax(T[] a) throws IllegalArgumentException
      Returns the indices of all maximum elements in the specified array.
      Type Parameters:
      T - the type of elements in the array
      Parameters:
      a - the array to search within
      Returns:
      an array of indices of all maximum elements. An empty array if the input array is empty.
      Throws:
      IllegalArgumentException
    • indicesOfAllMax

      public static <T> int[] indicesOfAllMax(T[] a, Comparator<? super T> cmp) throws IllegalArgumentException
      Returns the indices of all maximum elements in the specified array using the provided comparator.
      Type Parameters:
      T - the type of elements in the array
      Parameters:
      a - the array to search within
      cmp - the comparator to compare elements of the array
      Returns:
      an array of indices of all maximum elements. An empty array if the input array is empty.
      Throws:
      IllegalArgumentException
    • indicesOfAllMax

      public static <T extends Comparable<? super T>> int[] indicesOfAllMax(Collection<? extends T> c) throws IllegalArgumentException
      Returns the indices of all maximum elements in the specified collection.
      Type Parameters:
      T - the type of elements in the collection
      Parameters:
      c - the collection to search within
      Returns:
      an array of indices of all maximum elements. An empty array if the input collection is empty.
      Throws:
      IllegalArgumentException
    • indicesOfAllMax

      public static <T> int[] indicesOfAllMax(Collection<? extends T> c, Comparator<? super T> cmp) throws IllegalArgumentException
      Returns the indices of all maximum elements in the specified collection using the provided comparator.
      Type Parameters:
      T - the type of elements in the collection
      Parameters:
      c - the collection to search within
      cmp - the comparator to compare elements of the collection
      Returns:
      an array of indices of all maximum elements. An empty array if the input collection is empty.
      Throws:
      IllegalArgumentException
    • indicesOfAll

      public static int[] indicesOfAll(Object[] a, Object valueToFind)
      Returns the indices of all occurrences of the specified value in the given array.
      Parameters:
      a - the array to search within
      valueToFind - the value to find in the array
      Returns:
      an array of indices of all occurrences of the specified value
    • indicesOfAll

      public static int[] indicesOfAll(Object[] a, Object valueToFind, int startIndex)
      Returns the indices of all occurrences of the specified value in the given array, starting the search from the specified index.
      Parameters:
      a - the array to search within
      valueToFind - the value to find in the array
      startIndex - the index to start the search from
      Returns:
      an array of indices of all occurrences of the specified value
    • indicesOfAll

      public static int[] indicesOfAll(Collection<?> c, Object valueToFind)
      Returns the indices of all occurrences of the specified value in the specified collection.
      Parameters:
      c - the collection to search within
      valueToFind - the value to find in the collection
      Returns:
      an array of indices of all occurrences of the specified value
    • indicesOfAll

      public static int[] indicesOfAll(Collection<?> c, Object valueToFind, int startIndex)
      Returns the indices of all occurrences of the specified value in the specified collection, starting the search from the specified index.
      Parameters:
      c - the collection to search within
      valueToFind - the value to find in the collection
      startIndex - the index to start the search from
      Returns:
      an array of indices of all occurrences of the specified value
    • indicesOfAll

      public static <T> int[] indicesOfAll(T[] a, Predicate<? super T> predicate)
      Returns the indices of all elements in the specified array that match the given predicate.
      Type Parameters:
      T - the type of elements in the array
      Parameters:
      a - the array to search within
      predicate - the predicate to apply to elements of the array
      Returns:
      an array of indices of all elements that match the predicate. An empty array if the input array is empty.
    • indicesOfAll

      public static <T> int[] indicesOfAll(T[] a, Predicate<? super T> predicate, int startIndex)
      Returns the indices of all elements in the specified array that match the given predicate, starting the search from the specified index.
      Type Parameters:
      T - the type of elements in the array
      Parameters:
      a - the array to search within
      predicate - the predicate to apply to elements of the array
      startIndex - the index to start the search from
      Returns:
      an array of indices of all elements that match the predicate. An empty array if the input array is empty.
    • indicesOfAll

      public static <T> int[] indicesOfAll(Collection<? extends T> c, Predicate<? super T> predicate)
      Returns the indices of all elements in the specified collection that match the given predicate.
      Type Parameters:
      T - the type of elements in the collection
      Parameters:
      c - the collection to search within
      predicate - the predicate to apply to elements of the collection
      Returns:
      an array of indices of all elements that match the predicate. An empty array if the input collection is empty.
    • indicesOfAll

      public static <T> int[] indicesOfAll(Collection<? extends T> c, Predicate<? super T> predicate, int fromIndex)
      Returns the indices of all elements in the specified collection that match the given predicate, starting the search from the specified index.
      Type Parameters:
      T - the type of elements in the collection
      Parameters:
      c - the collection to search within
      predicate - the predicate to apply to elements of the collection
      startIndex - the index to start the search from
      Returns:
      an array of indices of all elements that match the predicate. An empty array if the input collection is empty.
    • isTrue

      @Beta public static boolean isTrue(Boolean bool)
      Returns true if the specified boolean is Boolean.TRUE, not null or Boolean.FALSE.
      Parameters:
      bool - the Boolean to check
      Returns:
      true if the Boolean is Boolean.TRUE, false otherwise
    • isNotTrue

      @Beta public static boolean isNotTrue(Boolean bool)
      Returns true if the specified boolean is null or Boolean.FALSE.
      Parameters:
      bool - the Boolean to check
      Returns:
      true if the Boolean is null or Boolean.FALSE, false otherwise
    • isFalse

      @Beta public static boolean isFalse(Boolean bool)
      Returns true if the specified boolean is Boolean.FALSE, not null or Boolean.TRUE.
      Parameters:
      bool - the Boolean to check
      Returns:
      true if the Boolean is Boolean.FALSE, false otherwise
    • isNotFalse

      @Beta public static boolean isNotFalse(Boolean bool)
      Returns true if the specified boolean is null or Boolean.TRUE.
      Parameters:
      bool - the Boolean to check
      Returns:
      true if the Boolean is null or Boolean.TRUE, false otherwise
    • negate

      @MayReturnNull @Beta public static Boolean negate(Boolean bool)

      Note: copied from Apache commons Lang under Apache license v2.0

      Negates the specified boolean.

      If null is passed in, null will be returned.

      NOTE: This returns null and will throw a NullPointerException if autoboxed to a boolean.

         BooleanUtils.negate(Boolean.TRUE)  = Boolean.FALSE;
         BooleanUtils.negate(Boolean.FALSE) = Boolean.TRUE;
         BooleanUtils.negate(null)          = null;
       
      Parameters:
      bool - the Boolean to negate, may be null
      Returns:
      the negated Boolean, or null if null input
    • negate

      @Beta public static void negate(boolean[] a)
      Negates all elements in the specified boolean array.
      Parameters:
      a - the boolean array to negate
    • negate

      @Beta public static void negate(boolean[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Negates all elements in the specified range of the boolean array.
      Parameters:
      a - the boolean array to negate
      fromIndex - the starting index (inclusive) of the range to negate
      toIndex - the ending index (exclusive) of the range to negate
      Throws:
      IndexOutOfBoundsException - if the specified range is out of bounds
    • unmodifiableCollection

      public static <T> Collection<T> unmodifiableCollection(Collection<? extends T> c)
      Returns an unmodifiable view of the specified collection, or an immutable/unmodifiable empty collection if the specified collection is null.
      Type Parameters:
      T - the type of elements in the collection
      Parameters:
      c - the collection for which an unmodifiable view is to be returned
      Returns:
      an unmodifiable view of the specified collection, or an immutable/unmodifiable empty collection if the specified collection is null
    • unmodifiableList

      public static <T> List<T> unmodifiableList(List<? extends T> list)
      Returns an unmodifiable view of the specified list, or an immutable/unmodifiable empty list if the specified list is null.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      list - the list for which an unmodifiable view is to be returned
      Returns:
      an unmodifiable view of the specified list, or an immutable/unmodifiable empty list if the specified list is null
    • unmodifiableSet

      public static <T> Set<T> unmodifiableSet(Set<? extends T> s)
      Returns an unmodifiable view of the specified set, or an immutable/unmodifiable empty set if the specified set is null.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      s - the set for which an unmodifiable view is to be returned
      Returns:
      an unmodifiable view of the specified set, or an immutable/unmodifiable empty set if the specified set is null
    • unmodifiableSortedSet

      public static <T> SortedSet<T> unmodifiableSortedSet(SortedSet<T> s)
      Returns an unmodifiable view of the specified sorted set, or an immutable/unmodifiable empty sorted set if the specified sorted set is null.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      s - the sorted set for which an unmodifiable view is to be returned
      Returns:
      an unmodifiable view of the specified sorted set, or an immutable/unmodifiable empty sorted set if the specified sorted set is null
    • unmodifiableNavigableSet

      public static <T> NavigableSet<T> unmodifiableNavigableSet(NavigableSet<T> s)
      Returns an unmodifiable view of the specified navigable set, or an immutable/unmodifiable empty navigable set if the specified navigable set is null.
      Type Parameters:
      T - the type of elements in the set
      Parameters:
      s - the navigable set for which an unmodifiable view is to be returned
      Returns:
      an unmodifiable view of the specified navigable set, or an immutable/unmodifiable empty navigable set if the specified navigable set is null
    • unmodifiableMap

      public static <K, V> Map<K,V> unmodifiableMap(Map<? extends K,? extends V> m)
      Returns an unmodifiable view of the specified map, or an immutable/unmodifiable empty map if the specified map is null.
      Type Parameters:
      K - the type of keys in the map
      V - the type of values in the map
      Parameters:
      m - the map for which an unmodifiable view is to be returned
      Returns:
      an unmodifiable view of the specified map, or an immutable/unmodifiable empty map if the specified map is null
    • unmodifiableSortedMap

      public static <K, V> SortedMap<K,V> unmodifiableSortedMap(SortedMap<K,? extends V> m)
      Returns an unmodifiable view of the specified sorted map, or an immutable/unmodifiable empty sorted map if the specified map is null.
      Type Parameters:
      K - the type of keys in the map
      V - the type of values in the map
      Parameters:
      m - the sorted map for which an unmodifiable view is to be returned
      Returns:
      an unmodifiable view of the specified sorted map, or an immutable/unmodifiable empty sorted map if the specified map is null
    • unmodifiableNavigableMap

      public static <K, V> NavigableMap<K,V> unmodifiableNavigableMap(NavigableMap<K,? extends V> m)
      Returns an unmodifiable view of the specified navigable map, or an immutable/unmodifiable empty navigable map if the specified map is null.
      Type Parameters:
      K - the type of keys in the map
      V - the type of values in the map
      Parameters:
      m - the navigable map for which an unmodifiable view is to be returned
      Returns:
      an unmodifiable view of the specified navigable map, or an immutable/unmodifiable empty navigable map if the specified map is null